Skip to content

Menu

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+D

Add the next match of the current selection to the selection

From the docs, not run by us
⇧⌘L / Ctrl+Shift+L

Select every match of the current selection at once

From the docs, not run by us
⌥⌘↑ / Ctrl+Alt+Up

Insert an extra cursor on the line above

Linux: Shift+Alt+Up

From the docs, not run by us
⌥⌘↓ / Ctrl+Alt+Down

Insert an extra cursor on the line below

Linux: Shift+Alt+Down

From the docs, not run by us
⇧⌥ + drag / Shift+Alt + drag

Draw a column (box) selection with the mouse

From the docs, not run by us
⌥↑ / Alt+Up

Move the current line or selected lines up one line

From the docs, not run by us
⇧⌥↓ / Shift+Alt+Down

Duplicate the current line below the cursor

Linux default differs: Ctrl+Shift+Alt+Down

From the docs, not run by us
⌃⇧⌘→ / Shift+Alt+Right

Expand the selection to the next enclosing syntax block

From the docs, not run by us
⌥⌘[ / Ctrl+Shift+[

Fold the code region at the cursor

From the docs, not run by us
⌃Space / Ctrl+Space

Trigger IntelliSense suggestions manually

From the docs, not run by us
F12

Go to the definition of the symbol under the cursor

From the docs, not run by us
⌥F12 / Alt+F12

Peek the definition inline without leaving the file

Linux: Ctrl+Shift+F10

From the docs, not run by us
F2

Rename a symbol everywhere it is referenced

From the docs, not run by us
⇧⌥F / Shift+Alt+F

Format the whole document with the default formatter

Linux: Ctrl+Shift+I

From the docs, not run by us
⌘B / Ctrl+B

Hide or show the primary sidebar

From the docs, not run by us
⌃` / Ctrl+`

Toggle the integrated terminal panel

From the docs, not run by us
⌘\ / Ctrl+\

Split the editor so the file opens side by side

From the docs, not run by us
⌘K Z / Ctrl+K Z

Enter Zen mode; press Escape twice to leave

From the docs, not run by us
⇧⌘V / Ctrl+Shift+V

Open the rendered preview of a Markdown file

From the docs, not run by us

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+I

Open the Chat view in the secondary sidebar

From the docs, not run by us
⌘N / Ctrl+N (in Chat view)

Start a fresh chat session when focus is in the Chat view

From the docs, not run by us
⌘I / Ctrl+I

Open inline chat on the code under the cursor

From the docs, not run by us
⇧⌥⌘L / Ctrl+Shift+Alt+L

Open Quick Chat as a floating box over the editor

From the docs, not run by us
Tab

Accept the grey inline completion Copilot is suggesting

From the docs, not run by us
Escape

Dismiss the current inline completion

From the docs, not run by us

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+S

Open the Keyboard Shortcuts editor to search and rebind keys

From the docs, not run by us
⌘K ⌘K / Ctrl+K Ctrl+K (in keybindings.json)

Record a key press and insert a ready-made JSON rule for it

From the docs, not run by us
{ "key": "tab", "command": "-jumpToNextSnippetPlaceholder" }

Remove a default binding by prefixing the command with a minus sign

From the docs, not run by us
"when": "editorLangId == python"

Limit a binding to one language with a when clause

From the docs, not run by us
Developer: Toggle Keyboard Shortcuts Troubleshooting

Log which command each key press dispatches, in the Output panel

From the docs, not run by us
Preferences: Open Settings (JSON)

Edit settings.json directly, for options keybindings can't change

Try it: vscode-settings-generatorFrom the docs, not run by us

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.

  1. Double-click retryCount to select it.
  2. Press ⌘D / Ctrl+D four 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.
  3. 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.

Sources

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.

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe
Reviews and commentsShow

Comments

Sign in to leave a comment.

Loading comments…