Get Started With Visual Studio Code

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!

vs

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. Its 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.

mobile

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.

seections

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.

example

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.

commands

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

file

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.

config

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.

f1

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

commands

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

install

Via the visual studio code marketplace:

markketplace

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, 'extinst' to bring up the extension gallery dropdown and then type the language name to filter the results.

results

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

Whats next

There is 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 Smile | :)

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

Read more articles on Visual Studio Code: