Skip to content

Get amazing at VS Code ๐Ÿš€

This guide is aimed at helping you becoma a VS Code Wizard ๐Ÿง™โ€โ™‚๏ธ. Itโ€™s a work in progress, so if you have any suggestions, please let us know! It will teach you concepts and shortcuts that will make you a better and faster developer. Do not try to use all of these at once, but rather pick one or two at a time and practice them until they become second nature.

The Command Palette ๐ŸŽจ

The command palette is the most important tool in VS Code. It allows you to do anything in VS Code, and itโ€™s the fastest way to do it. Itโ€™s also the quickest way to find out what you can do in VS Code. Itโ€™s the one thing you should learn first.

To open the command palette, press Ctrl + Shift + P.

Settings โš™๏ธ

Find the settings by pressing Ctrl + , or opening the Command Palette (Ctrl + Shift + P) and searching for โ€œSettingsโ€. Consider changing the default behavior from the UI to using a JSON-file to make it easier to search for settings and to copy-paste settings from others.

Shortcuts ๐Ÿšด

Change and add new shortcuts by opening the Command Palette (Ctrl + Shift + P) and searching for โ€œKeyboard Shortcutsโ€. Access the JSON-version with the โ€œOpen Keyboard Shortcuts (JSON)โ€ command.

Jumping Horizontally โ†”๏ธ

Jumping one character at a time

  • Right - Move cursor one character to the right โžก๏ธ
  • Left - Move cursor one character to the left โฌ…๏ธ

Jumping to the beginning/end of a word

  • Ctrl + Left - Jump to the beginning of the word ๐Ÿ
  • Ctrl + Right - Jump to the end of the word ๐Ÿ
  • Enable camelCase Navigation to jump between words in camelCase variables. Hereโ€™s how to enable it in your shortcuts.json:
[
{
"key": "ctrl+right",
"command": "cursorWordPartRight",
"when": "textInputFocus"
},
{
"key": "ctrl+shift+right",
"command": "cursorWordPartRightSelect",
"when": "textInputFocus"
},
{
"key": "ctrl+left",
"command": "cursorWordPartLeft",
"when": "textInputFocus"
},
{
"key": "ctrl+shift+left",
"command": "cursorWordPartLeftSelect",
"when": "textInputFocus"
},
{
"key": "ctrl+backspace",
"command": "deleteWordPartLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+backspace",
"command": "deleteWordPartRight",
"when": "textInputFocus && !editorReadonly"
}
]

Jumping to the beginning/end of a line

  • Home - Jump to the beginning of the line ๐Ÿ 
  • End - Jump to the end of the line ๐Ÿ

Jumping Vertically โ†•๏ธ

Jumping one line at a time

  • Up - Jump one line up โฌ†๏ธ
  • Down - Jump one line down โฌ‡๏ธ

Jumping to the beginning/end of a file

  • Ctrl + Home - Jump to the beginning of the file ๐Ÿ“„
  • Ctrl + End - Jump to the end of the file ๐Ÿ“„

Selecting Text ๐Ÿ“

Select text with Shift and any movement command. A neat trick is to select a whole line by jumping to the end and then selecting backwards. This can be done by pressing Shift + End and then Shift + Left. Which of course works in the other direction.

  • Ctrl + P - Open the file search, shows recently opened files ๐Ÿ”
  • Ctrl + Tab - Switch between open files ๐Ÿ”
  • Ctrl + Shift + Tab - Switch between open files in reverse order ๐Ÿ”™
  • Ctrl + Page Down - Go to the next file โญ๏ธ
  • Ctrl + Page Up - Go to the previous file โฎ๏ธ
  • Ctrl + Shift + E - Open Explorer ๐Ÿ—‚
  • Ctrl + Shift + F - Open Search ๐Ÿ”
  • Ctrl + Shift + H - Open Replace ๐Ÿ” 
  • Ctrl + B - Open/Hide Sidebar ๐Ÿฅท
  • Ctrl + 1 - Focus on the first panel, usually takes you back to your code editor ๐Ÿง

Editing โœ๏ธ

IntelliSense ๐Ÿ’ก

IntelliSense provides code completion and suggestions. Activate it with Ctrl + Space.

Quick Fix ๐Ÿ”ง

Quick Fix offers suggestions for code errors. Activate it with Ctrl + ..

Go to Definition ๐Ÿ”

Jump to the definition of a variable or function with F12 or Ctrl + Click.

Find all references ๐Ÿ”

Find all references to a variable or function with Alt + Shift + F12.

Errors โš ๏ธ

Jump to errors and warnings with F8 (next) and Shift + F8 (previous).

Imports ๐Ÿ“ฆ

Organize imports, sorting them and removing unused ones, with Alt + Shift + O.

Comments

Toggling line comments works both for single lines and for multiple lines Ctrl + โ€™ ๐Ÿ—จ๏ธ

Extensions ๐Ÿงฉ

Editing Web Apps ๐Ÿ’ป

  • EditorConfig for VS Code: Ensures consistency in code.
  • GitLens: Adds Git insights directly in the editor.
  • Select Line Status: Displays selected lines in the status bar.
  • IntelliCode: Provides AI-assisted IntelliSense by showing recommended completion items for your code context at the top of the completions list.
  • Live Server: Launch a development local Server with live reload feature for static & dynamic pages.
  • Path Intellisense: Autocomplete file names.
  • CodeSnap: Take beautiful screenshots of your code
  • YAML: Support for YAML files by Red Hat.
  • Rainbow CSV: Highlight CSV columns.

JavaScript & TypeScript

CSS

Markdown ๐Ÿ“