This is my personal cheat sheet for Microsoft Visual Studio Code (VS Code). Mainly, this is to record little commands and things that I am constantly forgetting (especially unique ones related to the unique plugins I use).

  1. Visual Studio Shortcuts
  2. Vscode Cheat Sheet Download
  3. Vscode Command Cheat Sheet

VSCode cheat sheet of all shortcuts and commands. VS Code gives you fine control over when your key bindings are enabled through the optional when clause. If your key binding doesn't have a when clause, the key binding is globally available at all times. A when clause evaluates to either Boolean true or false for enabling key bindings. VS Code Cheat Sheet Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. VS Code Cheat Sheet tries to provide a basic reference for beginner and advanced developers, lower the entry barrier for newcomers, and help veterans refresh the old tricks. Cheat sheet for Visual Studio Code. Visual Studio Code Handy Shortcuts (Linux) ^K^S: Shortcuts list ^⇧F: Search in the project ^⇧N: Opens a new instance of VS Code ^⇧I: Format code ^E: Search for a file in a project ^P: Search for a file in all projects ^N: Open a new unsaved file: Handy Shortcuts (Mac) ⌘. Press Ctrl + Shift + P (Win, Linux) / Cmd + Shift + P (Mac) and search for the Open CSS Flexbox Cheatsheet command. Press Ctrl + K K (Win, Linux) / Cmd + K K (Mac) keyboard shortcut. Hover any display: flex declaration and click the Open CSS Flexbox Cheatsheet link in the popup.

Keyboard shortcuts for Windows

General

ActionKey(s)
Show Command PaletteCTRL + SHIFT + P, F1
Quick Open, Go to File…CTRL + P
New window/instanceCTRL + SHIFT + N
Close window/instanceCTRL + SHIFT + W
User SettingsCTRL + ,
Keyboard ShortcutsCTRL + KCTRL + S

Basic editing

Vscode cheat sheet template
ActionKey(s)
Cut line (empty selection)Ctrl + X
Copy line (empty selection)Ctrl + C
Move line up/downAlt + /
Copy line up/downShift + Alt + /
Delete lineCtrl + Shift + K
Insert line belowCtrl + Enter
Insert line aboveCtrl + Shift + Enter
Jump to matching bracketCtrl + Shift +
Indent/outdent lineCtrl + ] / [
Go to beginning/end of lineHome / End
Go to beginning of fileCtrl + Home
Go to end of fileCtrl + End
Scroll line up/downCtrl + /
Scroll page up/downAlt + PgUp / PgDn
Fold (collapse) regionCtrl + Shift + [
Unfold (uncollapse) regionCtrl + Shift + ]
Fold (collapse) all subregionsCtrl + KCtrl + [
Unfold (uncollapse) all subregionsCtrl + KCtrl + ]
Fold (collapse) all regionsCtrl + KCtrl + 0
Unfold (uncollapse) all regionsCtrl + KCtrl + J
Add line commentCtrl + KCtrl + C
Remove line commentCtrl + KCtrl + U
Toggle line commentCtrl + /
Toggle block commentShift + Alt + A
Toggle word wrapAlt + Z

Navigation

ActionKey(s)
Show all SymbolsCTRL + T
Go to Line...CTRL + G
Go to File...CTRL + P
Go to Symbol...CTRL + SHIFT + O
Show Problems panelCTRL + SHIFT + M
Go to next error or warningF8
Go to previous error or warningSHIFT + F8
Navigate editor group historyCTRL + SHIFT + TAB
Go back / forwardALT + /
Toggle Tab moves focusCTRL + M

Search and replace

ActionKey(s)
FindCTRL + F
ReplaceCTRL + H
Find next/previousF3 / SHIFT + F3
Select all occurences of Find matchALT + ENTER
Add selection to next Find matchCTRL + D
Move last selection to next Find matchCTRL + K CTRL + D
Toggle case-sensitive / regex / whole wordALT + C / R / W

Multi-cursor and selection

ActionKey(s)
Insert cursorALT + Click
Insert cursor above / belowCTRL + ALT + /
Undo last cursor operationCTRL + U
Insert cursor at end of each line selectedSHIFT + ALT + I
Select current lineCTRL + L
Select all occurrences of current selectionCTRL + SHIFT + L
Select all occurrences of current wordCTRL + F2
Expand selectionSHIFT + ALT +
Shrink selectionSHIFT + ALT +
Column (box) selectionSHIFT + ALT + (drag mouse)
Column (box) selectionCTRL + SHIFT + ALT + (arrow key)
Column (box) selection page up/downCTRL + SHIFT + ALT + PgUp / PgDn

Rich languages editing

ActionKey(s)
Trigger suggestionCTRL + SPACE
Trigger parameter hintsCTRL + SHIFT + SPACE
Format documentSHIFT + ALT + F
Format selectionCTRL + K CTRL + F
Go to DefinitionF12
Peek DefinitionALT + F12
Open Definition to the sideCTRL + KF12
Quick FixCTRL + .
Show ReferencesSHIFT + F12
Rename SymbolF2
Trim trailing whitespaceCTRL + KCTRL + X
Change file languageCTRL + KM

Editor management

ActionKey(s)
Close editorCTRL + F4, CTRL +
Close folderCTRL + KF
Split editorCTRL +
Focus into 1st, 2nd or 3rd editor groupCTRL + 1 / 2 / 3
Focus into previous/next editor groupCTRL + K CTRL + /
Move editor left/rightCTRL + SHIFT + PgUp / PgDn
Move active editor groupCTRL + K /
Visual

File management

Sheet
ActionKey(s)
New FileCTRL + N
Open File...CTRL + O
SaveCTRL + S
Save As...CTRL + SHIFT + S
Save AllCTRL + K S
CloseCTRL + F4
Close AllCTRL + KCTRL + W
Reopen closed editorCTRL + SHIFT + T
Enter Keep preview mode editor openCTRL + K
Open nextCTRL + Tab
Open previousCTRL + SHIFT + Tab
Copy path of active fileCTRL + K P
Reveal active file in ExplorerCTRL + K R
Show active file in new window/instanceCTRL + K O

Display

ActionKey(s)
Toggle full screenF11
Toggle editor layout (horizontal/vertical)SHIFT + ALT + 0
Zoom in/outCTRL + = / -
Toggle Sidebar visibilityCTRL + B
Show Explorer / Toggle focusCTRL + SHIFT + E
Show SearchCTRL + SHIFT + F
Show Source ControlCTRL + SHIFT + G
Show DebugCTRL + SHIFT + D
Show ExtensionsCTRL + SHIFT + X
Replace in filesCTRL + SHIFT + H
Toggle Search detailsCTRL + SHIFT + J
Show Output panelCTRL + SHIFT + U
Open Markdown previewCTRL + SHIFT + V
Open Markdown preview to the sideCTRL + K V
Zen Mode (Esc Esc to exit)CTRL + K Z

Debug

ActionKey(s)
Toggle breakpointF9
Start/ContinueF5
StopSHIFT + F5
Step into/outF11 / SHIFT + F11
Step overF10
Show hoverCTRL + K CTRL + I

Integrated terminal

ActionKey(s)
Show integrated terminalCTRL + `
Create new terminalCTRL + SHIFT + `
Copy selectionCTRL + C
Paste into active terminalCTRL + V
Scroll up/downCTRL + ↑ / ↓
Scroll page up/downSHIFT + PgUp / PgDn
Scroll to top/bottomCTRL + Home / End

For other operating systems’ keyboard shortcuts and additional information, see Key Bindings for Visual Studio Code.

Preference settings

Following is NOT an exhaustive list of all preference settings that are available. There are more, but these are just the ones I have so far found useful.

To access settings, go to File > Preferences > Settings, or press CTRL + ,

SettingDescription
editor.minimap.enabledControls whether the minimap is shown.
editor.renderControlCharactersControls whether the editor should render control characters.
editor.renderWhitespaceControls whether the editor should render whitespace characters.
explorer.compactFoldersControls whether the explorer should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example.
html.autoClosingTagsEnable/disable autoclosing of HTML tags.
javascript.updateImportsOnFileMove.enabledEnable/disable automatic updating of import paths when you rename or move a file in VS Code. Requires using TypeScript 2.9 or newer in the workspace.
window.zoomLevelAdjust the zoom level of the window. The original size is 0 and each increment above (e.g. 1) or below (e.g. -1) represents zooming 20% larger or smaller. You can also enter decimals to adjust the zoom level with a finer granularity.
workbench.tree.indentControls tree indentation in pixels.
workbench.tree.renderIndentGuidesControls whether the tree should render indent guides.

Plugins

Visual Studio Shortcuts

HTML Tag Wrap

Plugin dependency: htmltagwrap

Wraps selected code with HTML tags.

Usage

  • Select one or more blocks of text or strings of text.
  • Press Alt + W or Option + W for Mac.
  • Type the tag name you want.
Cheat

By default, pressing spacebar will deselect the closing tags, so you can add attributes to the opening tags (you can turn this feature off, see below). If nothing is selected when you run htmltagwrap, it will add an opening and closing tag at the cursor position.

NOTE: This extension works best in files that either use tabs or spaces for indentation. It may not work as well with mixed tabs/spaces.

Flexbox cheatsheet inside VS Code

Vscode

Another week, another VS Code extension. I’ve published two so far and this is my third in just a month. I’m not participating in any sort of “30 VS Code extensions” challenge. The ideas keep popping up in my head and I can’t help myself but try to make something out of them.

It’s needless to say that I enjoy doing this quite a lot because these extensions are something I’ve been missing in my work. So by building them, I benefit directly and they make my work as a front-end developer a little bit easier.

Over the last few years flexbox got more and more popular. And rightly so, because it helps us build one-dimensional layouts much faster. Have you tried positioning something in the middle of an element using flexbox? It’s fun, right?

But there’s a problem! Remembering all flexbox properties can be hard. I know it’s hard for me! Should I use justify-content or align-items to do X? What values does justify-content accept? There are quite many of them and we’re not always sure which one does what. That’s why we have our favorite articles, guides, cheatsheets, etc., to consult during those times. But they all “live” outside of the code editor and that forces us to switch context.

A week ago I asked myself “Why not have a flexbox cheatsheet inside VS Code where I can quickly look up what I need and continue my work? Why do I need to switch context? Why isn’t there a tool that lets me do that?”. That’d be great, right?

I think so too, so I built it! 🚀

I’m thrilled to share my new extension “CSS Flexbox Cheatsheet”. Here’s a little demo:

Vscode Cheat Sheet Download

Currently there are two ways to open the cheatsheet:

  • By pressing Ctrl+Shift+P (Win) / Cmd+Shift+P (Mac) and searching for the Open Flexbox Cheatsheet command.
  • Hovering any display: flex declaration and clicking the Open Flexbox Cheatsheet link in the popup (as shown in the demo).

I have a few ideas for future improvements but I’d like to share it with the world in order to get feedback. So if you work with CSS, please give it a try. I hope you find it useful.

Vscode Command Cheat Sheet

Update: The cheatsheet used in the extension is available online as well and is done by Darek Kay.