VS Code Keyboard Shortcuts Cheat Sheet for Windows, macOS, and Linux

The essential VS Code keyboard shortcuts every developer should know, grouped by task with clear Windows/Linux and macOS keys side by side.

6 min read

VS Code ships with hundreds of keyboard shortcuts. This cheat sheet covers the ones you will reach for every day, grouped by what you are doing: editing, navigating, searching, working with the terminal, or debugging.

Each table shows the Windows/Linux key first, then the macOS key.

Modifier key translations: Ctrl on Windows/Linux is Cmd on macOS. Alt on Windows/Linux is Opt on macOS.

Open anything fast

These three shortcuts are your entry points to everything else in VS Code. Memorize them first.

ActionWindows / LinuxmacOS
Command Palette (run any command)Ctrl+Shift+PCmd+Shift+P
Quick Open (open any file)Ctrl+PCmd+P
Keyboard Shortcuts referenceCtrl+K Ctrl+SCmd+K Cmd+S

The Command Palette lets you type a command name instead of finding it in a menu. Quick Open finds any file in your project by typing part of its name. If you are new to these tools, the guide on using the Command Palette walks through every feature.

Basic editing

ActionWindows / LinuxmacOS
Undo / RedoCtrl+Z / Ctrl+YCmd+Z / Cmd+Shift+Z
Cut / Copy / Paste line (no selection needed)Ctrl+X / Ctrl+C / Ctrl+VCmd+X / Cmd+C / Cmd+V
Move line up / downAlt+Up / Alt+DownOpt+Up / Opt+Down
Copy line up / downShift+Alt+Up / Shift+Alt+DownShift+Opt+Up / Shift+Opt+Down
Delete lineCtrl+Shift+KCmd+Shift+K
Insert line below / aboveCtrl+Enter / Ctrl+Shift+EnterCmd+Enter / Cmd+Shift+Enter
Toggle line commentCtrl+/Cmd+/
Toggle block commentShift+Alt+AShift+Opt+A
Format documentShift+Alt+FShift+Opt+F
Format selectionCtrl+K Ctrl+FCmd+K Cmd+F
Indent / Outdent lineCtrl+] / Ctrl+[Cmd+] / Cmd+[

Multiple cursors and selection

ActionWindows / LinuxmacOS
Add cursor above / belowCtrl+Alt+Up / Ctrl+Alt+DownCmd+Opt+Up / Cmd+Opt+Down
Add cursor at clickAlt+ClickOpt+Click
Select next occurrence of wordCtrl+DCmd+D
Select all occurrences of wordCtrl+Shift+LCmd+Shift+L
Skip next occurrence (while using Ctrl+D)Ctrl+K Ctrl+DCmd+K Cmd+D
Select current lineCtrl+LCmd+L
Expand / shrink selectionShift+Alt+Right / Shift+Alt+LeftCtrl+Shift+Cmd+Right / Ctrl+Shift+Cmd+Left
Column (box) selectionShift+Alt+dragShift+Opt+drag

Find and replace

ActionWindows / LinuxmacOS
Find in fileCtrl+FCmd+F
Find next / previousF3 / Shift+F3Cmd+G / Cmd+Shift+G
Replace in fileCtrl+HCmd+Opt+F
Find across all filesCtrl+Shift+FCmd+Shift+F
Replace across all filesCtrl+Shift+HCmd+Shift+H

The Find control seeds its search from selected text. Select a word, press Ctrl+F, and it appears in the search box. Toggle Match Case, Match Whole Word, and regex from the icons inside the Find control.

ActionWindows / LinuxmacOS
Go to fileCtrl+PCmd+P
Go to symbol in fileCtrl+Shift+OCmd+Shift+O
Go to symbol in workspaceCtrl+TCmd+T
Go to lineCtrl+GCtrl+G
Go to definitionF12F12
Go to referencesShift+F12Shift+F12
Peek definitionAlt+F12Opt+F12
Rename symbolF2F2
Switch between open editorsCtrl+TabCtrl+Tab
Go back / forwardAlt+Left / Alt+RightCtrl+- / Ctrl+Shift+-
Focus breadcrumbsCtrl+Shift+.Cmd+Shift+.

On macOS, Cmd+G is not Go to Line. It repeats the last Find, so use Ctrl+G for Go to Line instead.

Terminal

ActionWindows / LinuxmacOS
Toggle terminalCtrl+`Ctrl+`
New terminalCtrl+Shift+`Ctrl+Shift+`
Switch between terminalsCtrl+PageUp / Ctrl+PageDownCmd+Shift+[ / Cmd+Shift+]
Split terminalCtrl+Shift+5Cmd+Shift+5
Clear terminalCtrl+KCmd+K
Focus next / previous paneAlt+Right / Alt+LeftCmd+Opt+Right / Cmd+Opt+Left

Debugging

ActionWindows / LinuxmacOS
Start / Continue debuggingF5F5
Step overF10F10
Step intoF11F11
Step outShift+F11Shift+F11
Toggle breakpointF9F9
Show Debug ConsoleCtrl+Shift+YCmd+Shift+Y

Display and layout

ActionWindows / LinuxmacOS
Toggle sidebar visibilityCtrl+BCmd+B
Toggle ExplorerCtrl+Shift+ECmd+Shift+E
Toggle SearchCtrl+Shift+FCmd+Shift+F
Toggle TerminalCtrl+`Ctrl+`
Zen ModeCtrl+K ZCmd+K Z
Close editorCtrl+WCmd+W
Reopen closed editorCtrl+Shift+TCmd+Shift+T

How to find any shortcut

You do not need to memorize every shortcut. Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (macOS).

From there:

  • Search by command name. Type comment to see all comment-related shortcuts.
  • Search by key. Type ctrl+d to see what Ctrl+D does.
  • Sort by source. Click the source column to separate built-in from user and extension shortcuts.
  • Find conflicts. Right-click any entry and select Show Same Keybindings.

How to change a shortcut

Find the command in the Keyboard Shortcuts editor. Click the pencil icon on the left, or double-click the row. Press your new key combination and press Enter.

Right-click any button, menu item, or UI element in VS Code and select Configure Keybinding to jump straight to that action in the editor.

Your custom shortcuts are saved in keybindings.json. To open the raw file, run Preferences: Open Keyboard Shortcuts (JSON) from the Command Palette. For a complete walkthrough of editing keybindings, see how to change keyboard shortcuts.

When a shortcut does not work

Check for an operating system conflict

macOS uses Ctrl+Space for Spotlight and Cmd+Space for Spotlight search, which can capture the key before VS Code sees it.

Check your GPU driver software

Some GPU driver software, especially NVIDIA, overrides Alt+arrow shortcuts. Check your graphics control panel.

Check for an extension conflict

An extension may have registered the same keybinding. Open the Keyboard Shortcuts editor and search for the key to see which command wins.

Run the troubleshooting command

Run Developer: Toggle Keyboard Shortcuts Troubleshooting from the Command Palette. Press your key and look at the Output panel to see how VS Code interpreted it.

Install a keymap from your old editor

If you are coming from another editor, you do not need to relearn every shortcut. Open the Command Palette and run Preferences: Keymaps. VS Code lists popular keymap extensions: Sublime Text, Atom, Vim, IntelliJ IDEA, Eclipse, and more. Install one and your muscle memory transfers immediately.

You can also browse the Keymaps category on the Marketplace.

Rune AI

Rune AI

Key Insights

  • Keep hands on the keyboard: Command Palette (Ctrl+Shift+P / Cmd+Shift+P), Quick Open (Ctrl+P / Cmd+P), and the keyboard shortcut reference (Ctrl+K Ctrl+S / Cmd+K Cmd+S) are your three most important shortcuts.
  • Editing: Ctrl+D / Cmd+D (select next occurrence), Alt+Up or Down (move line), Ctrl+/ / Cmd+/ (toggle comment).
  • Navigation: Ctrl+Tab (switch files), Ctrl+G (go to line), F12 (go to definition).
  • Terminal: Ctrl+ (toggle), Ctrl+Shift+ (new terminal), Ctrl+Shift+5 (split).
  • Search: Ctrl+F / Cmd+F (find), Ctrl+Shift+F / Cmd+Shift+F (find across files).
  • Remap any shortcut: Ctrl+K Ctrl+S / Cmd+K Cmd+S opens the editor where you can search by command or by key press.
RunePowered by Rune AI

Frequently Asked Questions

How do I change a keyboard shortcut?

Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (macOS). Find the command, click the pencil icon next to it, and press your new key combination. You can also right-click any UI element and select Configure Keybinding.

How do I see all shortcuts I have changed?

In the Keyboard Shortcuts editor, select the More Actions (...) menu and choose Show User Keybindings. This applies the @source:user filter and shows only shortcuts you have customized.

How can I use shortcuts from my old editor?

Install a keymap extension from the Marketplace. Open the Command Palette, run Preferences: Keymaps, and pick the extension for your old editor: Sublime Text, Atom, Vim, IntelliJ, or others.

Conclusion

You now have the 30+ keyboard shortcuts that matter most, organized by the task you are doing. Print the official PDF reference from Help > Keyboard Shortcut Reference, keep this page open as a quick lookup, and remap any shortcut that collides with your operating system or muscle memory. If you want to edit keybindings.json directly, read the guide on changing keyboard shortcuts.