Visual Studio Code: Beginners guide

VS Code (Visual Studio Code) is a free open source text editor that offers lots of functionality by default and also has an easy to use Marketplace where you can find many useful extensions.

VS Code is more than a text editor, with the right extensions is an IDE for TypeScript and Angular for example, but we won’t talk of it now.

If you are Administrator User install the System Installation, else you can try User installation or Portable.

In my opinion, this and Sublime Text are the best editors available now, differences:

VS Code pros

  • just install it and it’s ready to go, instead with Sublime Text you have to install Package Control to use additional packages and for many basic features a package is required (e. g. trim spaces at the end of lines)

VS Code cons

  • high RAM usage, slower than Sublime at startup
  • the search function loses vs Sublime Text, it doesn’t have a multi line search

IMHO: if you want a very good editor use VS Code, if you want the best text editor available and you have time and will to configure it choosing the packages you want, go for Sublime Text!

Features

Visual Studio Code User Interface

  • Press Ctrl + Shift + P to access the Command Palette that helps you find all possible features
  • Compare files just choosing them in the open editors bar, right click, Compare Selected
  • Open a folder in the Activity bar on the left and add subfolders and files
  • It’s simple to configure, e.g. you want to disable “press ENTER to accept the editor suggestion” (you can accept that also pressing TAB) just add this line to your user settings:
    “editor.acceptSuggestionOnEnter”: “off”

Shortcuts

  • Ctrl + Shift + P: Open Command Palette
  • Alt + Shift + Click: Square selection (cursorColumnSelect)
  • Alt + Shift + I: (on selected lines) Add Cursor to line ends, square selection
  • Alt + Click: Add additional cursor
  • Ctrl + Shift + L: Add cursor to each occurrence of current selected text
  • Alt + Left (Alt + Right): Navigate between opened files

Extensions

  • Rest Client by Huachao Mao is a fantastic extension you can use to invoke Rest services! Infos in the Marketplace link and here Joseph Woodward REST Client, an elegant alternative to Postman
  • Remote Development allows you to work in SSH with servers
  • XML Tools by Josh Johnson
    • format XML, you will just need to select “XML Tools format as XML” form the command palette to auto format an XML file
    • Extension Settings: xmlTools.enableXmlTreeView: Enables the XML Tree View for XML documents in the vs code outline
  • change-case allows you to modify the case of a selected string to camelcase, kebabcase, snakecase and so on
  • Highlight Bad Chars highlights in red character like wrong spaces or ‘ that aren’t well supported, for example spaces converted by Skype
  • Sort lines: select a few rows and through the Command Palette launch Sort lines (ascending, case insensitive): it will sort the rows!
  • Filter Line: it allows to filter line of a saved file by string (contained or not) and regex. Like a replace all line, but handier
  • Macros

Themes

VS Code is complete even in the themes section, just access the Command Palette, Themes > Monokai

Documentation