Visual Studio Code - Tips & Tricks
Tags: development, tools, tipstricks, visualstudiocode
Published: 2018-02-10 22:33:53

---
title: "Visual Studio Code - Tips & Tricks"
published: true
tags: development,tools,tips & tricks,visual studio code
canonical_url: https://stefancosma.xyz/2017/01/08/visual-studio-code-tips-tricks/
---

 ![Visual Studio Code - Tips & Tricks](https://stefancosma.xyz/content/images/2017/01/5.gif)

If you're following me on Twitter you probably know how much I enjoy using Microsoft's Visual Studio Code. So much, that one of my tweets is currently featured on their [main page](https://code.visualstudio.com/).

But this article is not about how much I enjoy my code editor, it's about what things you can do with this code editor. From useful extensions to shortcuts you probably didn't know about or even making your code editor more light on the eyes, this article is going to showcase some awesome stuff that I found while using it.

## Extensions

We begin our showcase with some awesome extensions. Now, I'm not going to share all the extensions that I use because some of them are really project focused, but instead I'm going to share the ones that are more generic and make my life as a developer much more easier.

1. [Auto Close Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag) - Automatically add HTML/XML close tag. 
2. [Git History (git log)](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory) - View git log, file or line History. 
3. [HTML CSS Class Completion](https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion) - Provides CSS class name completion for the HTML class attribute based on the CSS files on your workspace. 
4. [HTML Preview](https://marketplace.visualstudio.com/items?itemName=tht13.html-preview-vscode) - An extension to preview HTML or Jade files while editing them. 
5. [HTML Snippets](https://marketplace.visualstudio.com/items?itemName=abusaidm.html-snippets) - Full HTML tags including HTML5 Snippets 
6. [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets) - Code snippets for JavaScript in ES6 syntax. 
7. [JavaScript Atom Grammar](https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-atom-grammar) - The Atom editor's JavaScript text mate grammar. 
8. [jQuery Code Snippets](https://marketplace.visualstudio.com/items?itemName=donjayamanne.jquerysnippets) - Over 130 jQuery Code Snippets 
9. [jshint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.jshint) - Integrates JSHint into VS Code. JSHint is a linter for JavaScript. 
10. [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) - Synchronize Settings, Snippets, launch, keybindings, workspaces and extensions Across Multiple Machines using Github Gist. 
11. [Spelling and Grammar Checker](https://marketplace.visualstudio.com/items?itemName=seanmcbreen.Spell) - Uses a web service to detect mistakes and suggest fixes - great for Markdown or any text file. 
12. [SVG Viewer](https://marketplace.visualstudio.com/items?itemName=cssho.vscode-svgviewer) - Pretty self explanatory.

The extensions that I listed above are some of the ones that I use on a daily basis. If I were to choose that ones that I couldn't live without it would be #1, #2, #6, #9, #10.

For example #10 is a life saver because I'm always switching between my work MB Pro and the MB Air I have at home, so by having a system in place that helps me synchronize my settings is textbook awesome.

## Shortcuts

Next up are shortcuts. I usually have a few shortcuts that I absolutely can't live without. For example `CTRL + D` for multiselect is a must have.

When VS Code came along with it's integrated Terminal and introduced shortcuts for it, I was hooked. If you're like me and hate to always have to switch between the code editor and the Terminal then you're going to enjoy this. I usually tend to avoid to use the trackpad when I write code that's why I'm going to share some shortcuts that will help you while you code and need a Terminal at the same time.

1. `CTRL + `` - with this shortcut you can toggle the integrated Terminal. 
2. `CTRL + SHIFT + `` - this shortcut will add a new Terminal instance, so you can easily work with multiple things at the same time. 
3. But what if you want to switch between terminal instances? I added a few key bindings so I can easily switch between terminal instances. Of course you can customize them to your liking. 

```
[  
   {  
      "key":"ctrl+shift+=",
      "command":"workbench.action.terminal.focusNext",
      "when":"terminalFocus"
   },
   {  
      "key":"ctrl+shift+-",
      "command":"workbench.action.terminal.focusPrevious",
      "when":"terminalFocus"
   }
]
```

1. `CTRL + Q` - In a recent updated the team behind VS Code introduces a new feature. The ability to switch between the different views in the sidebar. Using this shortcut you can easily switch between the Explorer view or the Github view or even the search view. 
2. `CMD / WIN + B` - I for one like to keep things as light as possible when I'm writing code. With this shortcut you can easily show or hide the sidebar.

The shortcuts I outline above are the ones that I use most often. There are lots of them, that I didn't even mention, and if I did it would overlook the whole purpose of this article. If you know any more, that you think are really useful, let me know and I'll add them to the list.

## Misc

Since I can't end the article by talking about shortcuts, here are some more cool things you can do in VS Code. Did you know you can hide the activity bar from the View menu? Well, now you do. This feature was added a recent updated and I can say that it is very helpful, even if one has enough real-estate on his/hers monitors.

What about looks? I, for one, prefer the Spacegray theme. I liked that theme ever since I first found it available while I was using Sublime Text 2. Luckily someone made it available for VS Code as well. Check it out [here](https://marketplace.visualstudio.com/items?itemName=ionutvmi.spacegray-vscode).

And last, but certainly not least, did you know you can compare files out of the box? I recently needed to compare two different versions of the same file and because they were not on Github, I needed another easy way to achieve this. After a few searches and some extensions later I stumbled upon an article that outlines how you can do that directly inside VS Code. And because I like to give credit where credit is due here is [the article in question](http://dailydotnettips.com/2015/06/04/how-to-compare-files-in-visual-studio-code/).

Now, don't get me wrong, I know the things I shared in this article are just a small taste of what VS Code can do, that is why I'm extending an invitation to anyone who is using VS Code to share their experience and their tips and tricks.

Until next time, code long and prosper!

_Image credit: [Guillaume Kurkdjian](http://guillaumekurkdjian.com/)_



_This post was originally published on [stefancosma.xyz](https://stefancosma.xyz/2017/01/08/visual-studio-code-tips-tricks/)_