Skip to content

Instantly share code, notes, and snippets.

@cchauche
Last active April 21, 2021 22:47
Show Gist options
  • Save cchauche/d235d348b965d447a9d55ffcc2e64846 to your computer and use it in GitHub Desktop.
Save cchauche/d235d348b965d447a9d55ffcc2e64846 to your computer and use it in GitHub Desktop.

Get to Know VS Code

VS Code is a feature rich piece of software and we will barely scratch the surface of what it can do. They have excellent documentation, if you find time and are curious to explore check out their Getting Started guide. You can find all sorts of good stuff looking through there.

Table of Contents


Main Features Overview

Main Features Diagram

Editor(s) Groups

The main area to edit your files. You can open as many editors as you like side by side vertically and horizontally.

Panels

You can display different panels below the editor region for output or debug information, errors and warnings, or an integrated terminal. Panel can also be moved to the right for more vertical space.

Activity Bar

Located on the far left-hand side, this lets you switch between views and gives you additional context-specific indicators, like the number of outgoing changes when Git is enabled.

Side Bar

Contains different views like the File Explorer to assist you while working on your project.

Status Bar

Located along the bottom of the editor, it contains information about the opened project and the files you edit.


VS Code Settings

User Settings VS Workspace Settings

Before we start talking about any settings it is important to understand that VS Code uses two different sets of settings. There are the user settings which apply all the projects that you open with VS Code and then there are the Workspace Settings which only apply to a single project. Those settings will be stored in the root folder of your project in a folder called .vscode. These workspace settings take precedent over any conflicting user settings.

Find Your Settings

VS Code has a plethora of settings but they make it very easy to access, change and search those settings. The settings can be accessed multiple ways my preferred method is using the command pallette (⇧⌘P) then just typing 'settings'.

Note that this will also give you an option to open the JSON settings file if you prefer not to use the GUI VS Code provides


Keyboard Shortcuts

VS Code has a ton of built in keyboard shortcuts to make you work faster. I highly recommend you download the shortcut cheatsheet and if you can print it and place it somewhere that you can easily reference it while working.

You can always access these from VS code from the help menu. Help > Keyboard Shortcut Reference (⌘K ⌘R)

New Window Playground

Try out lots of helpful features in the interactive playground accessible when you open a new blank window. Find Interactive Playground in new window

My Most Used Shortcuts

General

Shortcut Command
⇧⌘P Show command Palette
⌘P Quick Open files

Basic Editing

Shortcut Command
⌥↑ / ⌥↓ Move line up/down
⇧⌥↑ / ⇧⌥ ↓ Copy line up/down
⌘K Delete line
⌘] / ⌘[ Indent/Outdent line
Home (fn←) Move cursor to start of line
End (fn→) Move cursor to end of line
⌘/ Toggle line comment
⇧⌥A Toggle block comment

Multi-cursor And Selection

Shortcut Command
⌥ + Left Click Insert cursor new cursor at click
⌘⌥↑ / ⌘⌥↓ Insert cursor above/below
⇧⌘I Insert cursor at end of each selected line
⇧⌘L Select all occurrences of current selection
⌘D Select current word
^⇧⌘→ / ^⇧⌘← Expand / Shrink selection

Search and Replace

Shortcut Command
⌘F Find
⌥⌘F Replace
⇧⌘F Find in file

Rich Language Editing

Shortcut Command
F2 Rename Symbol
⌥F12 Peek definition
⇧⌥F Format document
⌘K ⌘F Format selection

Navigation

Shortcut Command
^TAB / ^⇧TAB Cycle through tab history
^- / ^⇧- Go back/forward through tabs

Editor Management

Shortcut Command
⌘ \ | Split Editor
⌘1,⌘2, ⌘... Focus in to editor #
⌘W Close editor
⌘K ⌘W Close all

File Management

Shortcut Command
⌘S Save
⌥⌘S Save All

Display

Shortcut Command
⌘= / ⌘- Zoom in/out
⌘B Toggle sidebar visibility
⇧⌘E Show file explorer
⇧⌘V Open Markdown preview
⌘K ⌘V Open Markdown preview to the side

Integrated Terminal

Shortcut Command
^` Open integrated terminal
^⇧` New terminal

Customize VS Code

Themes

Custom Shortcuts

Snippets

Emmet

Settings


Other Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment