Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / containers / docker

Get Started with Visual Studio Code

4.81/5 (34 votes)
17 Apr 2016CPOL7 min read 75.8K   417  
An introduction to the latest, leanest, most useful tool in the MS Visual Studio family!

Introduction

Visual Studio Code was launched by Microsoft in 2015, and since its launch, has gained a lot of attention, for all the best reasons. 'VS Code' is a free, lightweight, open-source, cross platform, code editor that works on Windows, Linux and OS X. If you have ever been held back by the clunkiness of the full Visual Studio and reached for notepad++ or Sublime text to edit a file or a light-weight project, then VS Code is for you. The overhead of the all encompassing Visual Studio is no longer there... VS Code is light, nimble, and quick. It does everything I have used Sublime for, and more (yes, including multi-line editing!).

While it is of course very powerful, Code does its thing in a very non intrusive, non prescriptive manner, gets out of your way and lets you get on with the task at hand; tools are available at reach, when you need them, and not always hanging around taking up screen and mind space.

(mind space, huh? ... yup! ... clear the clutter from your desk and screen, reduce the amount of distraction around you, and see how much better you can focus!)

This is a very short introduction article - I hope it whets your appetite for lightweight coding and encourages you to download and try VS Code out!

Image 1

Code supports debugging, has tightly integrated GIT control, syntax highlighting, intellisense, code snippets and refactoring. Code is extremely extensible / pluggable, and this, combined with its open source base, means both Microsoft and the development community, have really got behind the tool and pushed it to become something very useful and very powerful in a short space of time. I strongly recommend you check it out - when you do, if you find there is something missing, consider writing a plugin to scratch that itch! ...

Getting into the guts to extend BIG BIG Visual Studio itself, is quite doable - we can write extensions, plugins, etc. It's just, well ... in my experience, not quite as simple/quick as opening a file, banging in a bit of script, and letting fly to try something out... VS Code on the other hand, is lightweight, has a very straightforward way of doing things, and almost encourages you to hack around trying things out, simply because it is so easy to do. #WeLoveCode !

Get Started with Visual Studio Code

This fast-track introduction will give you a quick overview of VS-Code, how the app hangs together, where to find things, how you can use it, limitations, etc.

What is Visual Studio Code then?

As we have said, VS Code a lightweight code editor that is fully functional and cross platform. You can download and run the app on Mac, Windows and Linux. If you code in C#, JavaScript, if you WebDev, if you do mobile, VS Code is your friend...

Image 2

VS Code is described as being 'both file and folder based'. This means that you can use it as a tool to open and work on a single file, like a text editor on steroids, or use it to open a folder/project and work with all of the files there as a group and be equally as productive.

Layout / Finding Your Way Around

When you install the app in the first place, it seems very barren - intentionally so! ... here is an overview of the main sections...

Image 3

You can do a lot more with layout, and configure it to how you prefer to work. The editor will remember the last settings you had, so when you re-open, things are as you left them. You can also open two files side by side for comparison for example.

Image 4

Intuitive UI

As you would expect, finding your way around the app is quite intuitive. Here are a few examples:

You can select files in the explorer area, and right-click to execute OS and other commands against them.

Image 5

To open an existing file/project, and access many other features, go to the File menu.

Image 6

Customizing Your Workspace

In line with the lightweight editor, rather than being presented with nested tab after tab of form based flags and controls for turning things on and off, VS Code allows us to configure our workspace, color theme, and indeed the entire environment by directly editing a JSON based config file.

Image 7

Navigating with the Keyboard

One of the cool things for me with VS Code is the ability to stay mostly away from the mouse and keep tap-tap-tapping away at the keyboard with my productive little digits. Apart from the FILE menu, most of the commands I need to get at are contained under the COMMAND PALETTE section - the easiest way to get at this is to hit F1.

Image 8

Typing ? into the input field will show you a list of commands that are available to you.

Image 9

Extensions and Plugins

Although a very young technology, VS Code already has a vibrant marketplace for extensions and plugins. I love looking at plugins - there are some real gems out there that can really ramp up your productivity and give you amazing insight into your code and solutions. Docker hooks, Yeoman, Grunt, VS Cordova ... there are plugins and extensions for these and more. You can get to view extensions in two ways - either from within VS Code itself, or externally in the marketplace.

Via: F1 -> ext install

Image 10

Via the Visual Studio code marketplace:

Image 11

Language Support

There is inbuilt support for numerous languages, including C#, F#, Python, Javascript, Objective-C, Ruby, R, Visual-basic and SQL to name a few. Support for most of these languages with refactoring, colorising, intellisense, etc. is built in, and new features are being continuously added via the extension/plugin system. The framework is designed to assist and support all of the most modern languages, and you can add extension support really easily.

Type F1, 'ext inst' to bring up the extension gallery dropdown and then type the language name to filter the results.

Image 12

Find out more about language support and extensibility on the VS code website.

Update

As of April 14 2016, Visual Studio Code has just reached an official milestone of getting to Version 1. Since its launch a year ago, it has had over 2 million downloads, and is in use monthly by over 500, 000 developers. Built as an open platform, in less than six months, the editor has attracted over 1000 community contributed plugins and extensions - what a success story!

VS Code is fully localizable, and is currently shipping in nine languages. The community contributions to the codebase have been streaming in, and the team has consumed over 300 contributions into the live code-base from github. There is a great writeup about VS Code getting to version 1 over on the visual studio website - go read about it here.

I have attached a really useful "tips and tricks for visual studio code" for download at the top of the article - well worth grabbing a copy and reading!

What's Next

There's a whole big world out there beyond .NET and Visual Studio (as we have known it). If you are buried in Enterprise work all day, sometimes it can be hard to see beyond that. I would really encourage you to look at the awesome goodness that Microsoft have provided the community with VS Code, and to start playing with some of the amazing technologies that exist beyond the restrictions that our daily work sometimes places us in. More than likely, you'll find something that will be useful, you like, and will actually benefit the enterprise! .... If Microsoft can turn from hating on Open-Source to embracing it, then surely we can all start to reach out and learn new things :)

Finally, as always, if you enjoyed the article, please give it a vote at the top of the page.

Now - take five minutes, go to the VS Code website, download, and get coding!

History

  • Version 1 - 27 March 2016 - published
  • Version 2 - 14 April 2016 - VS Code reaches its official version-1 ! .. update for this
  • Version 3 - 17 Apr 2016 - added 'tips and tricks' download

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)