VS Code Keyboard Shortcuts Cheat Sheet for Mac, Windows and Linux
Checked against Visual Studio Code 1.148 on 28 November 2026. Each section links to the official docs it was checked against.
This sheet is for people who already use VS Code every day and want to stop reaching for the mouse. Keys were checked against the official docs for VS Code 1.148, released 25 November 2026. Each row shows the macOS key first and the Windows/Linux key second, with a note where Linux uses something different.
When to use what
Learn three keys before anything else: ⇧⌘P / Ctrl+Shift+P for the Command Palette, ⌘P / Ctrl+P to jump to a file, and ⇧⌘O / Ctrl+Shift+O to jump to a symbol in the current file. The palette shows the bound key next to every command, so it teaches you the rest as you go.
For edits, prefer ⌘D / Ctrl+D over find-and-replace when you want to change a handful of matches and look at each one. Use ⇧⌘L / Ctrl+Shift+L only when you are sure every match should change, because it grabs all of them, including ones you can't see. Use rename symbol (F2) instead of either when you are renaming a variable or function: it follows the language server, so it skips strings and comments that happen to contain the same word.
For AI help, open inline chat (⌘I / Ctrl+I) for a change to the code under your cursor, and the Chat view (⌃⌘I / Ctrl+Alt+I) for questions or edits that span files. If you use GitHub Copilot, our guide to getting more out of it covers prompting. If you are weighing editors, see Cursor vs VS Code: Cursor is a VS Code fork, so most keys below carry over.
On Linux, add-cursor-above/below is Shift+Alt+Up/Down because many desktops claim Ctrl+Alt+Up/Down for switching workspaces.
⌘D / Ctrl+DAdd the next match of the current selection to the selection
⇧⌘L / Ctrl+Shift+LSelect every match of the current selection at once
⌥⌘↑ / Ctrl+Alt+UpInsert an extra cursor on the line above
Linux: Shift+Alt+Up
⌥⌘↓ / Ctrl+Alt+DownInsert an extra cursor on the line below
Linux: Shift+Alt+Down
⇧⌥ + drag / Shift+Alt + dragDraw a column (box) selection with the mouse
⌥↑ / Alt+UpMove the current line or selected lines up one line
⇧⌥↓ / Shift+Alt+DownDuplicate the current line below the cursor
Linux default differs: Ctrl+Shift+Alt+Down
⌃⇧⌘→ / Shift+Alt+RightExpand the selection to the next enclosing syntax block
⌥⌘[ / Ctrl+Shift+[Fold the code region at the cursor
⌃Space / Ctrl+SpaceTrigger IntelliSense suggestions manually
F12Go to the definition of the symbol under the cursor
⌥F12 / Alt+F12Peek the definition inline without leaving the file
Linux: Ctrl+Shift+F10
F2Rename a symbol everywhere it is referenced
⇧⌥F / Shift+Alt+FFormat the whole document with the default formatter
Linux: Ctrl+Shift+I
⌘B / Ctrl+BHide or show the primary sidebar
⌃` / Ctrl+`Toggle the integrated terminal panel
⌘\ / Ctrl+\Split the editor so the file opens side by side
⌘K Z / Ctrl+K ZEnter Zen mode; press Escape twice to leave
⇧⌘V / Ctrl+Shift+VOpen the rendered preview of a Markdown file
These need the GitHub Copilot extension signed in. Inline chat and terminal inline chat share ⌘I / Ctrl+I; which one opens depends on where focus is.
⌃⌘I / Ctrl+Alt+IOpen the Chat view in the secondary sidebar
⌘N / Ctrl+N (in Chat view)Start a fresh chat session when focus is in the Chat view
⌘I / Ctrl+IOpen inline chat on the code under the cursor
⇧⌥⌘L / Ctrl+Shift+Alt+LOpen Quick Chat as a floating box over the editor
TabAccept the grey inline completion Copilot is suggesting
EscapeDismiss the current inline completion
Rules in keybindings.json are evaluated from the bottom up and the first match wins, so a later rule overrides an earlier one with the same key.
⌘K ⌘S / Ctrl+K Ctrl+SOpen the Keyboard Shortcuts editor to search and rebind keys
⌘K ⌘K / Ctrl+K Ctrl+K (in keybindings.json)Record a key press and insert a ready-made JSON rule for it
{ "key": "tab", "command": "-jumpToNextSnippetPlaceholder" }Remove a default binding by prefixing the command with a minus sign
"when": "editorLangId == python"Limit a binding to one language with a when clause
Developer: Toggle Keyboard Shortcuts TroubleshootingLog which command each key press dispatches, in the Output panel
Preferences: Open Settings (JSON)Edit settings.json directly, for options keybindings can't change
Worked example: Rename a config key in five places, then bind a key for it
Say retryCount appears five times near the top of a file and twice more in a comment at the bottom that you want to keep.
- Double-click
retryCountto select it. - Press
⌘D/Ctrl+Dfour times (five selections in total). Each press adds the next match and scrolls to it, so you can see what you are about to change. - Stop before the matches in the comment. Then type
maxRetries. Every cursor edits at once.
If it's a real variable, F2 is safer because it only touches references. Next, give yourself a shortcut for something you run often. Open the Keyboard Shortcuts editor, click the icon for the JSON file, and add:
[
{
"key": "ctrl+alt+t",
"command": "workbench.action.terminal.new",
"when": "!terminalFocus"
}
]
Now Ctrl+Alt+T opens a new terminal, but only when focus isn't already in a terminal, so shells that use that key still get it. If nothing happens, run Developer: Toggle Keyboard Shortcuts Troubleshooting, press the key, and read the log: it shows whether another extension or an OS shortcut caught the key first.
Common mistakes
Using Ctrl+Shift+L to rename a variable across a file.
Press F2 instead. Select-all-matches also changes the word inside strings and comments; rename follows the language server's references.
Copying Windows shortcuts from a blog post onto a Linux machine and finding they do nothing.
Check the Linux column: add-cursor, peek, format and navigate-back all use different keys on Linux, often because the desktop already owns the Windows key.
Editing the default keybindings file and wondering why the change disappears.
The defaults are read-only. Put your overrides in your own keybindings.json, opened from the Keyboard Shortcuts editor's JSON button.
Adding a new binding that silently loses to an extension's binding on the same key.
Remove the extension's rule with a minus-prefixed command, or add a tighter when clause, then confirm with the troubleshooting log.
Pressing ⌘I in the terminal and expecting the editor's inline chat.
The same key opens terminal inline chat when the terminal has focus. Click into the editor first, or use the Chat view key.
Related cheat sheets
Sources
- https://code.visualstudio.com/docs/configure/keybindings
- https://code.visualstudio.com/docs/getstarted/tips-and-tricks
- https://code.visualstudio.com/docs/editing/codebasics
- https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features
- https://code.visualstudio.com/updates
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.