Friday, March 31, 2017

Why I love Visual Studio Code

I just love Visual Studio Code and believe most of you must be feeling the same. On my code editor preferences, VS Code only seconds to Visual Studio.

In this post, thought of sharing some little tiny things that altogether makes VS Code a great editor. Let’s just start by creating a folder.

Quick Open

First I can just right click on the folder and open with VS Code. (I know it’s an old feature, but it’s super useful.)
SNAGHTML1ed23e5
Open with Code
This is one of my most favorite features. Once the VS Code is opened, I can open up a Integrated Terminal. That’s either by Menu Bar -> View -> Integrated Terminal or just by Ctrl+`.
image
Integrated Terminal
In Windows environment, you can use either PowerShell or cmd. (On the above image, I have customized the Integrated Terminal to use cmd, but PowerShell is the default. Will show you how easy it is to customize the VS Code to match your preference later in the post.)
image
Integrated Terminal
If you are worried about the command I typed here, I just created a React-Redux project using dotnet. Basically you can type any command which you do on cmd.

image
IntelliSense
You have fully IntelliSense support for most of the languages, here I am writing TypeScript code.

Keyboard Shortcuts

If you are so much addicted to the keyboard and hate using the mouse, there are plenty of shortcuts to do most of VS Code tasks without leaving the keyboard. Not to forget, all the keyboard shortcuts can be customized.

Here is a list of keyboard shortcuts available in VS Code.
Key Bindings for Visual Studio Code

But in default VS Code you might find some keyboard shortcuts are different when compared to Visual Studio. But don’t worry, there is an extension called Visual Studio Keymap to port all your Visual Studio shortcuts to VS Code.

There are hundreds of extensions available providing variety of features, here is a list of some extensions that I have installed.
image
Installed Extensions
VS Code lets you customize variety of options to suit your preference.
image
Customize
If you open up the Settings, you will see something like this.
image
Settings
Here on the left side you can see all the different settings that you can change. On the right side, it will either display User Settings or Workspace Settings. While User Settings are maintained in “C:\Users\{UserName}\AppData\Roaming\Code\User\settings.json”, Workspace Settings are maintained in “{CurrentExplorerFolder}\.vscode\settings.json”. Whatever the settings declared in those files will get applied in following order. Default Settings will get overridden by User Settings, and both Default and User Settings will get overridden by Workspace Settings.

Here is how I have customized my VS Code. The highlighted properties are for customizing the Integrated Terminal which I mentioned earlier in the post.
image
Customized Settings
Same way we can customize the keyboard shortcuts. User specific shortcuts will get stored in “C:\Users\{UserName}\AppData\Roaming\Code\User\keybindings.json”.

Well, these are some of the features that I love. If I started to write them all, I won’t be able to stop.

Happy Coding.

Regards,
Jaliya

No comments:

Post a Comment