Cheat Sheets

VS Code Keyboard Shortcuts Cheat Sheet (Windows, Mac, Linux PDF)

VS Code keyboard shortcuts let you edit, jump between files, drive the terminal and open Copilot chat without the mouse. Most chords match on Windows and Linux and swap Ctrl for Cmd on a Mac. A handful change meaning between platforms, and those are the ones that cost you a morning.

Original content from computingforgeeks.com - post 196621

This cheat sheet groups the keys by job, from editing and multiple cursors to debugging and AI chat, with a printable PDF. We checked every Linux key against the Default Keyboard Shortcuts file of VS Code 1.148 on Ubuntu 26.04 in November 2026, and the Windows and macOS columns against Microsoft’s printed reference sheets.

Which VS Code shortcuts should you learn first?

Learn the Command Palette first, because every other command in this sheet is reachable from it. It also prints the current key next to each command name, so the palette teaches you as you go. The fifteen chords below cover most of a working day in the editor.

ActionWindowsmacOSLinux
Command PaletteCtrl+Shift+P, F1Shift+Cmd+P, F1Ctrl+Shift+P, F1
Quick Open (go to file)Ctrl+PCmd+PCtrl+P
SettingsCtrl+,Cmd+,Ctrl+,
Keyboard Shortcuts editorCtrl+K Ctrl+SCmd+K Cmd+SCtrl+K Ctrl+S
Toggle line commentCtrl+/Cmd+/Ctrl+/
Move line up or downAlt+Up / DownOption+Up / DownAlt+Up / Down
Add next match to selectionCtrl+DCmd+DCtrl+D
Format documentShift+Alt+FShift+Option+FCtrl+Shift+I
Go to definitionF12F12F12
Rename symbolF2F2F2
Toggle terminalCtrl+`Ctrl+`Ctrl+`
Toggle sidebarCtrl+BCmd+BCtrl+B
Start or continue debuggingF5F5F5
Open Chat viewCtrl+Alt+ICtrl+Cmd+ICtrl+Alt+I
Inline chat in editor or terminalCtrl+ICmd+ICtrl+I

Notice the Format document row: Linux uses a completely different chord from Windows. That pattern repeats through the sheet. If you move between a Windows laptop and a Linux workstation, the platform differences section is the part worth reading twice.

Which editing shortcuts save the most time?

Line operations save the most time, because they replace the select, cut, move and paste routine with one chord. With nothing selected, Ctrl+X and Ctrl+C act on the whole line. That is the fastest way to lift a line out of one block and drop it into another.

ActionWindowsmacOSLinux
Cut or copy line (empty selection)Ctrl+X / Ctrl+CCmd+X / Cmd+CCtrl+X / Ctrl+C
Copy line downShift+Alt+DownShift+Option+DownCtrl+Shift+Alt+Down
Delete lineCtrl+Shift+KShift+Cmd+KCtrl+Shift+K
Insert line below / aboveCtrl+Enter / Ctrl+Shift+EnterCmd+Enter / Shift+Cmd+EnterCtrl+Enter / Ctrl+Shift+Enter
Indent / outdent lineCtrl+] / Ctrl+[Cmd+] / Cmd+[Ctrl+] / Ctrl+[
Toggle block commentShift+Alt+AShift+Option+ACtrl+Shift+A
Format selectionCtrl+K Ctrl+FCmd+K Cmd+FCtrl+K Ctrl+F
Quick FixCtrl+.Cmd+.Ctrl+.
Trigger suggestionCtrl+SpaceCtrl+SpaceCtrl+Space
Jump to matching bracketCtrl+Shift+\Shift+Cmd+\Ctrl+Shift+\
Fold / unfold regionCtrl+Shift+[ / ]Option+Cmd+[ / ]Ctrl+Shift+[ / ]
Toggle word wrapAlt+ZOption+ZAlt+Z
Find / replaceCtrl+F / Ctrl+HCmd+F / Option+Cmd+FCtrl+F / Ctrl+H
Find / replace in filesCtrl+Shift+F / Ctrl+Shift+HShift+Cmd+F / Shift+Cmd+HCtrl+Shift+F / Ctrl+Shift+H
Save allCtrl+K SOption+Cmd+Snot bound

Two rows surprise people on Linux, and both are easy to confirm on your own install:

  • Copy line down needs all three modifiers on Linux, and Shift+Alt+Down adds a cursor below there instead.
  • Save all has no default key on Linux. Ctrl+K S still fires there, but it runs Save without Formatting on the current file only.

If you want Save all on a key, bind it yourself in the Keyboard Shortcuts editor. The steps are in the section on changing a shortcut further down.

How do you use multiple cursors in VS Code?

Select a word and press Ctrl+D (Cmd+D on a Mac) for each next occurrence you want to edit at once. Every selection gets its own cursor, so whatever you type lands in all of them. Ctrl+K Ctrl+D skips an occurrence you did not mean to grab.

ActionWindowsmacOSLinux
Insert cursor at clickAlt+ClickOption+ClickAlt+Click
Add cursor above / belowCtrl+Alt+Up / DownOption+Cmd+Up / DownCtrl+Shift+Up / Down or Shift+Alt+Up / Down
Add next match / skip itCtrl+D / Ctrl+K Ctrl+DCmd+D / Cmd+K Cmd+DCtrl+D / Ctrl+K Ctrl+D
Select all occurrences of selectionCtrl+Shift+LShift+Cmd+LCtrl+Shift+L
Select all occurrences of wordCtrl+F2Cmd+F2Ctrl+F2
Cursor at end of each selected lineShift+Alt+IShift+Option+IShift+Alt+I
Undo last cursor operationCtrl+UCmd+UCtrl+U
Select current lineCtrl+LCmd+LCtrl+L
Expand selectionShift+Alt+RightCtrl+Shift+Cmd+RightShift+Alt+Right
Column (box) selection with mouseShift+Alt+dragShift+Option+dragShift+Alt+drag

Ctrl+D is smarter than a plain text search, and our test showed exactly how. In a small Python inventory file we double-clicked the role string web and kept pressing Ctrl+D. VS Code picked up the three standalone web values and skipped the web inside web01 and web02.

The find options explain it: Match Whole Word and Match Case were both switched on for that run. The selection count in the status bar then confirms what you are about to change before you type.

Ctrl+D in VS Code selecting three whole-word matches of web while skipping the web inside web01 and web02
  1. 1Match Whole Word
  2. 2selection count

If you need the partial matches too, that whole-word behaviour is the thing to check first. Ctrl+Shift+L is the blunter tool, since it selects every occurrence of the current selection in one go, which makes it quicker for a rename across a short file but riskier in a long one.

Use Ctrl+P to jump to any file by typing part of its name, then Ctrl+Shift+O to jump to a function or class inside it. Those two chords replace most clicking around in the Explorer, and Ctrl+T searches symbols across the whole workspace when you do not know which file holds them.

ActionWindowsmacOSLinux
Go to fileCtrl+PCmd+PCtrl+P
Go to lineCtrl+GCtrl+GCtrl+G
Go to symbol in fileCtrl+Shift+OShift+Cmd+OCtrl+Shift+O
Show all symbols (workspace)Ctrl+TCmd+TCtrl+T
Go to definitionF12F12F12
Peek definitionAlt+F12Option+F12Ctrl+Shift+F10
Show referencesShift+F12Shift+F12Shift+F12
Go back / forwardAlt+Left / Alt+RightCtrl+- / Ctrl+Shift+-Ctrl+Alt+- / Ctrl+Shift+-
Next error or warningF8F8F8
Problems panelCtrl+Shift+MShift+Cmd+MCtrl+Shift+M
Split editorCtrl+\Cmd+\Ctrl+\
Close editor / reopen closedCtrl+W / Ctrl+Shift+TCmd+W / Shift+Cmd+TCtrl+W / Ctrl+Shift+T
Zen ModeCtrl+K ZCmd+K ZCtrl+K Z

Go back is the key most people miss after an F12 jump into a library. On Linux it is Ctrl+Alt+Minus rather than the Alt+Left Windows users expect. If you installed VS Code on Ubuntu after years on Windows, these are the navigation keys to retrain first:

  • Ctrl+Alt+Minus returns you to the line you jumped from with F12.
  • Ctrl+Shift+F10 opens the peek window that Alt+F12 opens on Windows.
  • Ctrl+Shift+Minus moves forward again, where Windows uses Alt+Right.

Everything else in the navigation table matches Windows, so the muscle memory for Ctrl+P, Ctrl+G and F12 carries straight over.

Which shortcuts control the integrated terminal?

Ctrl+` (the backtick key) shows and hides the integrated terminal on every platform, and Ctrl+Shift+` opens a fresh one. Copy and paste follow each platform’s terminal habits. Linux uses Ctrl+Shift+C and Ctrl+Shift+V, while Windows keeps Ctrl+C for copying a selection.

ActionWindowsmacOSLinux
Toggle terminalCtrl+`Ctrl+`Ctrl+`
New terminalCtrl+Shift+`Ctrl+Shift+`Ctrl+Shift+`
Split terminalCtrl+Shift+5Cmd+\Ctrl+Shift+5
Copy / paste in terminalCtrl+C / Ctrl+VCmd+C / Cmd+VCtrl+Shift+C / Ctrl+Shift+V
Scroll one line up / downCtrl+Alt+PageUp / PageDownOption+Cmd+PageUp / PageDownCtrl+Shift+Up / Down
Scroll one page up / downShift+PageUp / PageDownPageUp / PageDownShift+PageUp / PageDown
Inline chat in terminalCtrl+ICmd+ICtrl+I

We split the terminal with Ctrl+Shift+5 and ran a different job in each pane, with the sidebar hidden through Ctrl+B to give the panes room. A split is worth it when one pane runs a long job and the other stays free for commands. Three checks tell you the split works:

  • Two panes appear side by side in the terminal panel after Ctrl+Shift+5.
  • Alt+Left and Alt+Right move the focus between the panes.
  • On Linux and macOS the new pane starts in the current directory of the first one. Windows starts it where the parent terminal was launched.
VS Code integrated terminal split into two panes with Ctrl+Shift+5 on Ubuntu, showing code --version output

Inside the terminal, most keys go to the shell rather than to VS Code, so your readline habits mostly still work. The exception is a short list of commands VS Code keeps for itself: on Linux, Ctrl+P and Ctrl+E open Quick Open instead of walking shell history or jumping to the end of the line. The terminal.integrated.commandsToSkipShell setting changes that list. The Linux terminal shortcuts cheat sheet covers those.

What are the VS Code debugging shortcuts?

F9 sets a breakpoint on the current line and F5 starts the debugger. The stepping keys are the same function keys on all three platforms. Only Restart and the Run and Debug view change modifiers, with Cmd taking the place of Ctrl on a Mac.

ActionWindowsmacOSLinux
Toggle breakpointF9F9F9
Start / continueF5F5F5
Run without debuggingCtrl+F5Ctrl+F5Ctrl+F5
Step overF10F10F10
Step into / step outF11 / Shift+F11F11 / Shift+F11F11 / Shift+F11
StopShift+F5Shift+F5Shift+F5
RestartCtrl+Shift+F5Shift+Cmd+F5Ctrl+Shift+F5
Run and Debug viewCtrl+Shift+DShift+Cmd+DCtrl+Shift+D

On a laptop, check the Fn lock first. Many laptop keyboards send brightness or volume on the top row unless Fn is held, which makes F5 and F10 look broken when the keyboard is really sending a media key. Before you blame VS Code, run through these:

  • F9 puts a red dot in the gutter next to the current line.
  • F5 opens the debug toolbar instead of changing screen brightness.
  • On a Mac, the standard function keys option is on in the Keyboard settings.

The macOS keyboard shortcuts guide lists the system chords on a Mac that can compete with VS Code for the same keys.

Which keys open Copilot and AI chat in VS Code?

Ctrl+Alt+I opens the Chat view on Windows and Linux (Ctrl+Cmd+I on a Mac). Ctrl+I starts inline chat right where your cursor sits in the editor or the terminal. Agent mode has its own chord, and it is the one that differs most between platforms.

ActionWindowsmacOSLinux
Open Chat viewCtrl+Alt+ICtrl+Cmd+ICtrl+Alt+I
Open chat in agent modeCtrl+Shift+IShift+Cmd+ICtrl+Shift+Alt+I
Inline chat (editor or terminal)Ctrl+ICmd+ICtrl+I
Quick chatCtrl+Shift+Alt+LShift+Option+Cmd+LCtrl+Shift+Alt+L
New chat session (chat focused)Ctrl+NCmd+NCtrl+N or Ctrl+L
Agent picker / model pickerCtrl+. / Ctrl+Alt+.Cmd+. / Option+Cmd+.Ctrl+. / Ctrl+Alt+.
Accept inline suggestionTabTabTab
Accept next word of suggestionCtrl+RightCmd+RightCtrl+Right
Dismiss inline suggestionEscapeEscapeEscape

To confirm what a chord does on your own install, open the Keyboard Shortcuts editor, switch on Record Keys and press the chord. We pressed Ctrl+Alt+I and VS Code listed three commands on it: Chat: Open Chat, View: Toggle Chat and a Toggle Chat Update Requirement entry. The when column decides which one runs, so sharing the chord is safe.

VS Code Record Keys mode showing ctrl+alt+i bound to Chat: Open Chat and View: Toggle Chat on Linux

The new-chat keys only work when the chat panel has focus. In the editor, Ctrl+L selects the current line and Ctrl+N opens an untitled file, so pressing them in your code will not clear the conversation. If you use Claude Code alongside Copilot, its keys live in the Claude Code cheat sheet.

Where do Windows, macOS and Linux keys differ?

macOS mostly swaps Ctrl for Cmd and Alt for Option, so a Windows chord translates predictably. Linux is the odd one out. Its defaults reassign several Alt chords, so a handful of keys there mean something different from the Windows chord you remember.

  • Shift+Alt+Down copies the line on Windows but adds a cursor below on Linux.
  • Ctrl+Shift+I opens agent mode on Windows but formats the document on Linux.
  • Go back is Alt+Left on Windows but Ctrl+Alt+Minus on Linux.
  • Shift+Alt+A toggles a block comment on Windows, while Linux uses Ctrl+Shift+A.
  • Save all is Ctrl+K S on Windows. On Linux the same chord saves only the current file without formatting it.

Test each of these once on your own machine and you will know which habits to keep. Microsoft lists every default per platform in its default keybindings reference. The copy that matches your build exactly, though, is the one VS Code generates for you, shown in the next section.

The same platform split runs through the desktop itself. Our Windows 11 keyboard shortcuts and Ubuntu keyboard shortcuts guides cover the system keys that sit around the editor.

How do you find or change a VS Code shortcut?

Press Ctrl+K Ctrl+S (Cmd+K Cmd+S on a Mac) to open the Keyboard Shortcuts editor, then type a command name into the Search box. Each row shows the command, its keybinding, the when condition that has to be true, and whether the binding came from the system, an extension or you.

VS Code Keyboard Shortcuts editor on Ubuntu filtered to add cursor, showing Ctrl+Shift+UpArrow and Shift+Alt+UpArrow
  1. 1Search box
  2. 2Record Keys
  3. 3Open Keyboard Shortcuts (JSON)

Searching “add cursor” on Linux shows why this editor beats any printed sheet. Add Cursor Above has two bindings, Ctrl+Shift+UpArrow and Shift+Alt+UpArrow, and the Linux PDF lists only one. The Record Keys button flips the search to matching by chord instead of by name. Open Keyboard Shortcuts (JSON) opens the file that stores your own overrides.

Every override lands in keybindings.json in your user profile, which on Linux is ~/.config/Code/User/keybindings.json. We used it to turn Ctrl+Shift+D into a duplicate-line key. That takes two entries: one adds the new binding, and one with a minus in front of the command removes the default Run and Debug binding from the chord.

[
    {
        "key": "ctrl+shift+d",
        "command": "editor.action.copyLinesDownAction",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+d",
        "command": "-workbench.view.debug"
    }
]

VS Code picks the file up on save, with no restart. Pressing Ctrl+Shift+D in the editor then duplicated the line instead of opening Run and Debug. Typing @source:user into the search box lists only your own bindings, which is the quickest way to audit what you have changed.

VS Code Keyboard Shortcuts editor filtered to @source:user showing Ctrl+Shift+D remapped to Copy Line Down

For the full list of defaults on your build, open the Command Palette and run Preferences: Open Default Keyboard Shortcuts (JSON). On our Ubuntu install it listed 1,202 bindings. The palette also offers Help: Keyboard Shortcuts Reference, which opens Microsoft’s printable PDF for your platform. Run it from the palette: its chord, Ctrl+K Ctrl+R, reverts the selected Git changes when the cursor sits in a tracked file.

VS Code Command Palette listing Open Keyboard Shortcuts, Open Default Keyboard Shortcuts (JSON) and Toggle Keyboard Shortcuts Troubleshooting

The same keybindings file works whether you installed VS Code on Fedora or Ubuntu, so copy it between machines (or let Settings Sync carry it) and your custom keys follow you.

Fix a shortcut that does nothing

When a chord does nothing, or does the wrong thing, turn on Developer: Toggle Keyboard Shortcuts Troubleshooting from the Command Palette and press the chord again. VS Code writes each key it receives to the Output panel, along with the binding it matched and the command it ran. We trimmed the timestamps, the [Window] tags and the keydown event lines from our log below to keep the matches readable.

[info] [KeybindingService]: | Resolving ctrl+[KeyD]
[info] [KeybindingService]: \ From 3 keybinding entries, matched editor.action.addSelectionToNextFindMatch, when: editorFocus, source: built-in.
[info] [KeybindingService]: + Invoking command editor.action.addSelectionToNextFindMatch.
[info] [KeybindingService]: | Resolving ctrl+alt+[KeyI]
[info] [KeybindingService]: \ From 3 keybinding entries, matched workbench.panel.chat, when: workbench.panel.chat.view.copilot.active, source: built-in.
[info] [KeybindingService]: + Invoking command workbench.panel.chat.

Read it from the top. “From 3 keybinding entries” tells you three bindings compete for that chord, and the when clause shows which condition won. If pressing the chord adds no “Received keydown event” line at all, VS Code never received the key. Something outside it, such as the desktop, a keyboard layout tool or a remote session, took it first.

VS Code Output panel with Keyboard Shortcuts Troubleshooting log resolving ctrl+d and ctrl+alt+i

Work through these checks in order, and stop at the first one that explains the problem:

  1. The troubleshooting log shows a “Resolving” line when you press the chord.
  2. The matched command in the log is the one you expected, not an extension’s binding.
  3. The when clause is true where your focus is (editor, terminal or chat).
  4. Searching @source:user shows no old override of yours on the same chord.
  5. On a laptop, the function keys send F5 and F10, not media keys.

Most dead shortcuts come down to check three: the chord is bound, but only where your focus isn’t. Turn the troubleshooting log off again when you’re done, since it logs every key you press, and browse the rest of our cheat sheets for the tools you use next to the editor.

Keep reading

Claude Code Cheat Sheet: Commands, Shortcuts and Flags (PDF) AI Claude Code Cheat Sheet: Commands, Shortcuts and Flags (PDF) OpenAI Codex CLI Cheat Sheet: Shortcuts, Commands, Flags (PDF) AI OpenAI Codex CLI Cheat Sheet: Shortcuts, Commands, Flags (PDF) Linux and DevOps Cheat Sheets (Free PDF Pack) Cheat Sheets Linux and DevOps Cheat Sheets (Free PDF Pack) netsh Commands Cheat Sheet: Wi-Fi, Firewall, Port Proxy (PDF) Cheat Sheets netsh Commands Cheat Sheet: Wi-Fi, Firewall, Port Proxy (PDF) journalctl Cheat Sheet: Filter, Follow and Trim Linux Logs Cheat Sheets journalctl Cheat Sheet: Filter, Follow and Trim Linux Logs Vim Cheat Sheet: Modes, Motions, Macros and .vimrc (Free PDF) Cheat Sheets Vim Cheat Sheet: Modes, Motions, Macros and .vimrc (Free PDF)

Leave a Comment

Press ESC to close