Visual Studio Code (VS Code) is a free open-source code editor released by Microsoft in 2015. Built on the Electron framework, it provides the same experience across Windows, macOS, and Linux. With its lightweight execution speed and rich extension ecosystem, it has become the most widely used editor among developers worldwide. To maximize VS Code productivity, mastering shortcuts is essential. Minimizing mouse usage and working keyboard-centrically significantly improves coding speed. This guide organizes VS Code’s core shortcuts by category and explains practical usage.

VS Code Overview

What is Visual Studio Code?

VS Code is a free open-source code editor developed by Microsoft, written in TypeScript and JavaScript, and built on the Electron framework. It supports IntelliSense, built-in Git, debugging, terminal, and rich extensions, providing IDE-like functionality.

VS Code vs Other Editors

FeatureVS CodeVimJetBrains IDESublime Text
PriceFreeFreePaid (Community free)Paid
SpeedFastVery FastSlowVery Fast
ExtensibilityVery HighHighHighHigh
Learning CurveLowHighMediumLow
DebuggingBuilt-inPluginBuilt-inPlugin
Git IntegrationBuilt-inPluginBuilt-inPlugin

Essential Shortcuts Summary

The most frequently used core shortcuts are summarized first.

ShortcutFunctionImportance
Ctrl+PQuick file openEssential
Ctrl+Shift+PCommand paletteEssential
Ctrl+DMulti-select same wordEssential
Alt+↑/↓Move lineEssential
Ctrl+/Toggle commentEssential
Ctrl+BToggle sidebarFrequent
Ctrl+``Toggle terminalFrequent
F12Go to definitionFrequent
Ctrl+Shift+FSearch all filesFrequent
Ctrl+\Split editorFrequent

General Commands

ShortcutFunction
Ctrl+Shift+P or F1Open command palette
Ctrl+PQuick Open file
Ctrl+Shift+NOpen new window
Ctrl+WClose current tab
Ctrl+,Open settings
Ctrl+K Ctrl+SOpen keyboard shortcuts settings

The command palette (Ctrl+Shift+P) is the core tool for accessing all VS Code features. Typing > searches commands, @ searches symbols, and # searches workspace symbols.

Basic Editing

Text Manipulation

ShortcutFunction
Ctrl+XCut line (current line when no selection)
Ctrl+CCopy line (current line when no selection)
Ctrl+Shift+KDelete line
Alt+↑/↓Move line up/down
Shift+Alt+↑/↓Copy line up/down
Ctrl+EnterInsert blank line below
Ctrl+Shift+EnterInsert blank line above

Indentation and Formatting

ShortcutFunction
Ctrl+]Indent
Ctrl+[Outdent
Ctrl+Shift+IFormat document
Ctrl+K Ctrl+FFormat selection

Comments

ShortcutFunction
Ctrl+/Toggle line comment
Ctrl+Shift+AToggle block comment
Ctrl+K Ctrl+CAdd line comment
Ctrl+K Ctrl+URemove line comment

Code Folding

ShortcutFunction
Ctrl+Shift+[Fold region
Ctrl+Shift+]Unfold region
Ctrl+K Ctrl+0Fold all regions
Ctrl+K Ctrl+JUnfold all regions

Multi-Cursor and Selection

What is Multi-Cursor?

Multi-cursor is a feature that places cursors at multiple positions simultaneously to perform the same edit at once. It dramatically reduces repetitive text modification work and is one of VS Code’s most powerful features.

ShortcutFunction
Alt+ClickAdd cursor at click position
Ctrl+Alt+↑/↓Add cursor above/below
Ctrl+DAdd next occurrence of current selection
Ctrl+Shift+LSelect all occurrences of current selection
Ctrl+F2Select all occurrences of current word
Shift+Alt+IInsert cursor at end of each selected line
Ctrl+UUndo last cursor operation
Shift+Alt+dragColumn (block) selection

Selection Expand/Shrink

ShortcutFunction
Shift+Alt+→Expand selection
Shift+Alt+←Shrink selection
Ctrl+LSelect current line
Ctrl+Shift+\\Jump to matching bracket

Search and Replace

ShortcutFunction
Ctrl+FFind in current file
Ctrl+HFind and replace in current file
Ctrl+Shift+FFind in all files
Ctrl+Shift+HFind and replace in all files
F3 / Shift+F3Next/previous search result
Alt+EnterSelect all search results
Ctrl+DAdd next match to selection
Ctrl+K Ctrl+DSkip current selection and select next match

To use regular expressions in the search box, press Alt+R to enable regex mode.

ShortcutFunction
Ctrl+GGo to specific line
Ctrl+PGo to file
Ctrl+Shift+OGo to symbol (current file)
Ctrl+TGo to symbol (workspace)
F12Go to definition
Alt+F12Peek definition
Shift+F12Show references
Ctrl+Shift+MOpen problems panel
F8 / Shift+F8Go to next/previous error
Ctrl+Alt+-Go to previous location (back)
Ctrl+Shift+-Go to next location (forward)

Editor Management

Window Splitting

ShortcutFunction
Ctrl+\Split editor
Ctrl+1/2/3Focus editor group 1/2/3
Ctrl+K Ctrl+←/→Focus previous/next editor group
Ctrl+K ←/→Move editor group

Tab Management

ShortcutFunction
Ctrl+TabGo to next tab
Ctrl+Shift+TabGo to previous tab
Ctrl+WClose current tab
Ctrl+K Ctrl+WClose all tabs
Ctrl+Shift+TReopen closed tab

Display

ShortcutFunction
F11Toggle full screen
Ctrl+BToggle sidebar
Ctrl+Shift+EOpen explorer
Ctrl+Shift+FOpen search panel
Ctrl+Shift+GOpen source control panel
Ctrl+Shift+DOpen debug panel
Ctrl+Shift+XOpen extensions panel
Ctrl+= / Ctrl+-Zoom in/out
Ctrl+K ZZen mode (focus mode)

File Management

ShortcutFunction
Ctrl+NNew file
Ctrl+OOpen file
Ctrl+SSave
Ctrl+Shift+SSave as
Ctrl+K PCopy active file path
Ctrl+K RReveal file in explorer
Ctrl+K OOpen file in new window

Code Intelligence

ShortcutFunction
Ctrl+SpaceShow autocomplete suggestions
Ctrl+Shift+SpaceShow parameter hints
Ctrl+.Quick Fix
F2Rename symbol (refactoring)
Ctrl+K Ctrl+IShow hover information

Debugging

ShortcutFunction
F5Start/continue debugging
Shift+F5Stop debugging
F9Toggle breakpoint
F10Step Over
F11Step Into
Shift+F11Step Out

Integrated Terminal

ShortcutFunction
Ctrl+`Toggle terminal
Ctrl+Shift+`Create new terminal
Ctrl+Shift+CCopy selected text
Ctrl+Shift+VPaste
Ctrl+↑/↓Terminal scroll

Customizing Shortcuts

VS Code shortcuts can be changed in the keyboard shortcuts settings opened with Ctrl+K Ctrl+S. For more detailed configuration, you can directly edit the keybindings.json file. If frequently used commands lack shortcuts or existing shortcuts are inconvenient, setting up your own shortcuts is recommended.

Conclusion

Mastering VS Code shortcuts allows you to work keyboard-centrically with minimal mouse usage, significantly improving coding speed and productivity. Rather than trying to memorize all shortcuts at first, it is effective to naturally use core shortcuts like Ctrl+P (open file), Ctrl+Shift+P (command palette), Ctrl+D (multi-select), and Ctrl+/ (comment), gradually adding other shortcuts. The complete shortcut list can be found in the VS Code official documentation’s Keyboard Shortcuts Reference.