Skip to main content
⚡ OpenDevDocs
Developer ToolsVS Code
toolsvscodeReferenceBeginner

VS Code: Essential Keyboard Shortcuts

Complete cheatsheet of the most important productivity keyboard shortcuts in Visual Studio Code for macOS, Windows, and Linux.

Verified: 2026-09-30
Tested on:vscode 1.93.x
Platforms:
linuxmacoswindows
#vscode#shortcuts#productivity#keybindings

Mastering editor keybindings drastically accelerates coding, file navigation, multi-cursor editing, and refactoring.


Essential General Navigation

ActionmacOSWindows / Linux
Command PaletteCmd + Shift + PCtrl + Shift + P
Quick Open FileCmd + PCtrl + P
Global Search across FilesCmd + Shift + FCtrl + Shift + F
Toggle Integrated TerminalCtrl + `Ctrl + `
Toggle Primary SidebarCmd + BCtrl + B
Split Editor WindowCmd + </kbd>Ctrl + </kbd>
Close Active EditorCmd + WCtrl + W

Code Editing & Multi-Cursor

ActionmacOSWindows / Linux
Add Next Match to SelectionCmd + DCtrl + D
Select All OccurrencesCmd + Shift + LCtrl + Shift + L
Insert Cursor Above / BelowCmd + Option + ↑/↓Ctrl + Alt + ↑/↓
Move Line Up / DownOption + ↑/↓Alt + ↑/↓
Duplicate Line Up / DownShift + Option + ↑/↓Shift + Alt + ↑/↓
Delete Entire LineCmd + Shift + KCtrl + Shift + K
Toggle Line CommentCmd + /Ctrl + /

Code Navigation & Refactoring

ActionmacOSWindows / Linux
Go to DefinitionF12 (or Cmd + Click)F12 (or Ctrl + Click)
Peek DefinitionOption + F12Alt + F12
Find All ReferencesShift + F12Shift + F12
Rename Symbol (F2 Refactor)F2F2
Format DocumentShift + Option + FShift + Alt + F
Quick Fix / Code ActionCmd + .Ctrl + .

Customizing Keyboard Shortcuts

Open keybindings JSON editor:

  • Open Command Palette $\rightarrow$ Preferences: Open Keyboard Shortcuts (JSON)
[
  {
    "key": "cmd+shift+r",
    "command": "workbench.action.reloadWindow"
  }
]

On this page