Top VScode Shortcuts For Mac and Windows

Top VScode Shortcuts For Mac and Windows
Top VScode Shortcuts For Mac and Windows

Quick answer. The most-used VS Code shortcuts are the Command Palette (Ctrl+Shift+P / ⇧⌘P), Quick Open (Ctrl+P / ⌘P), find across files (Ctrl+Shift+F / ⇧⌘F), duplicate a line (Shift+Alt+↓ / ⇧⌥↓), and add-next-cursor (Ctrl+D / ⌘D). The big difference: on macOS the primary modifier is Command (⌘), where Windows and Linux use Control.

Keyboard shortcuts are the fastest way to speed up your workflow in Visual Studio Code. Instead of reaching for the mouse to search files, move lines, or open the terminal, a two-key combination does it instantly. This guide lists the most useful Visual Studio Code shortcuts for both Mac and Windows, grouped by task, with every combination checked against the current VS Code defaults.

If you already lean on VS Code extensions to boost productivity, pairing them with the right keyboard shortcuts is the next step. All shortcuts below are the out-of-the-box defaults — you can remap any of them (see the customization section at the end).

What is VS Code?

Visual Studio Code is a free, open-source source-code editor built by Microsoft for Windows, macOS, and Linux. It handles debugging, syntax highlighting, intelligent code completion (IntelliSense), and refactoring, and is released under the permissive MIT license. Its large extension marketplace and fast, keyboard-first design are why it stays one of the most widely used editors for front-end and full-stack developers.

Visual Studio Code editor logo
Visual Studio Code

How do VS Code shortcuts differ on Mac and Windows?

Most VS Code shortcuts map one-to-one between platforms, but the modifier keys differ. Get these swaps right and almost every Windows shortcut has an obvious Mac equivalent:

  • Windows/Linux Ctrl → macOS (Command) for the majority of commands (save, find, Command Palette, etc.).
  • Windows/Linux Alt → macOS (Option) for line moves, word selection, and multi-cursor commands.
  • is Shift and is the literal Control key on Mac (a few commands, like Go to Line and Toggle Terminal, still use ⌃ on macOS).

Throughout the tables below, the Windows/Linux combination is on the left and the macOS combination (using ⌘ ⌥ ⇧ ⌃ symbols) is on the right.

What are the most useful VS Code shortcuts?

If you only memorize a handful, make it these. They cover the actions developers repeat dozens of times an hour.

ActionWindows / LinuxmacOS
Open the Command PaletteCtrl+Shift+P⇧⌘P
Quick Open / Go to FileCtrl+P⌘P
Find across all filesCtrl+Shift+F⇧⌘F
Find in current fileCtrl+F⌘F
Duplicate a line (down)Shift+Alt+↓⇧⌥↓
Move a line up / downAlt+↑ / Alt+↓⌥↑ / ⌥↓
Add cursor at next matchCtrl+D⌘D
Toggle line commentCtrl+/⌘/
Reopen last closed editorCtrl+Shift+T⇧⌘T
Toggle integrated terminalCtrl+`⌃`

General VS Code shortcuts

ActionWindows / LinuxmacOS
Command PaletteCtrl+Shift+P (or F1)⇧⌘P (or F1)
Quick Open / Go to FileCtrl+P⌘P
New windowCtrl+Shift+N⇧⌘N
Open SettingsCtrl+,⌘,
Keyboard Shortcuts editorCtrl+K Ctrl+S⌘K ⌘S

VS Code editing shortcuts

ActionWindows / LinuxmacOS
Cut line (no selection)Ctrl+X⌘X
Copy line (no selection)Ctrl+C⌘C
Delete lineCtrl+Shift+K⇧⌘K
Move line up / downAlt+↑ / Alt+↓⌥↑ / ⌥↓
Duplicate line up / downShift+Alt+↑ / Shift+Alt+↓⇧⌥↑ / ⇧⌥↓
Insert line below / aboveCtrl+Enter / Ctrl+Shift+Enter⌘⏎ / ⇧⌘⏎
Indent / outdentCtrl+] / Ctrl+[⌘] / ⌘[
Delete previous wordCtrl+Backspace⌥⌫
Toggle line commentCtrl+/⌘/
Toggle block commentShift+Alt+A⇧⌥A
Format documentShift+Alt+F⇧⌥F

Multi-cursor and selection shortcuts

ActionWindows / LinuxmacOS
Insert cursor (click)Alt+Click⌥Click
Insert cursor above / belowCtrl+Alt+↑ / Ctrl+Alt+↓⌥⌘↑ / ⌥⌘↓
Select current lineCtrl+L⌘L
Add next occurrence to selectionCtrl+D⌘D
Select all occurrences of selectionCtrl+Shift+L⇧⌘L
Change all occurrences of a wordCtrl+F2⌘F2
Extend selection word by wordCtrl+Shift+→ / Ctrl+Shift+←⌥⇧→ / ⌥⇧←
Select from cursor to line start / endShift+Home / Shift+End⇧⌘← / ⇧⌘→
ActionWindows / LinuxmacOS
Go to Symbol in fileCtrl+Shift+O⇧⌘O
Go to Symbol in workspaceCtrl+T⌘T
Go to lineCtrl+G⌃G
Go to DefinitionF12F12
Go back / forwardAlt+← / Alt+→⌃- / ⌃⇧-
Jump to start / end of fileCtrl+Home / Ctrl+End⌘↑ / ⌘↓
Jump to start / end of lineHome / End⌘← / ⌘→
Show Problems panelCtrl+Shift+M⇧⌘M

Search and replace shortcuts

ActionWindows / LinuxmacOS
Find in current fileCtrl+F⌘F
Replace in current fileCtrl+H⌥⌘F
Find across all filesCtrl+Shift+F⇧⌘F
Replace across all filesCtrl+Shift+H⇧⌘H
Change all occurrences of a wordCtrl+F2⌘F2
Rename symbolF2F2

Editor and window management shortcuts

ActionWindows / LinuxmacOS
Reopen last closed editorCtrl+Shift+T⇧⌘T
Close editorCtrl+W⌘W
Split editorCtrl+\⌘\
Focus editor group 1 / 2 / 3Ctrl+1 / Ctrl+2 / Ctrl+3⌘1 / ⌘2 / ⌘3
Cycle through open editorsCtrl+Tab⌃Tab

Display and panel shortcuts

ActionWindows / LinuxmacOS
Toggle integrated terminalCtrl+`⌃`
Toggle sidebarCtrl+B⌘B
Toggle Zen modeCtrl+K Z⌘K Z
Zoom in / outCtrl+= / Ctrl+-⌘= / ⌘-

Debugging shortcuts

ActionWindows / LinuxmacOS
Toggle breakpointF9F9
Start / continueF5F5
Step overF10F10
Step intoF11F11
Stop debuggingShift+F5⇧F5

How do I customize VS Code keyboard shortcuts?

Every shortcut above is a default that you can change. Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S (Windows) or ⌘K ⌘S (Mac), search for a command, and double-click it to record a new key combination. For bulk edits, run the Command Palette and choose Preferences: Open Keyboard Shortcuts (JSON) to edit keybindings.json directly. VS Code also ships printable cheat-sheet PDFs for Windows and macOS.

💡
Using an AI-first editor? Cursor IDE is built on Visual Studio Code, so nearly every shortcut in this guide works there too. See our complete Cursor IDE guide for AI-assisted coding on top of these fundamentals.

FAQ

What is the most important VS Code shortcut to learn first?

The Command Palette (Ctrl+Shift+P on Windows, ⇧⌘P on Mac). It exposes every command VS Code can run, so even if you forget a specific shortcut you can search for the action by name and run it from there.

How do I duplicate a line in VS Code?

Use Shift+Alt+↓ on Windows/Linux or ⇧⌥↓ on macOS to copy the current line below (use ↑ to copy above). You don't need to select anything first — just place the cursor on the line.

Why do the Mac shortcuts use ⌘ instead of Ctrl?

On macOS the Command (⌘) key is the standard primary modifier, so most VS Code commands that use Ctrl on Windows use ⌘ on Mac. A few commands, such as Go to Line and Toggle Terminal, keep the literal Control (⌃) key on Mac.

Can I change VS Code keyboard shortcuts?

Yes. Open the Keyboard Shortcuts editor (Ctrl+K Ctrl+S / ⌘K ⌘S), find the command, and assign your own combination. Advanced users can edit keybindings.json for bulk changes or to import a full keymap.

Do these shortcuts also work in Cursor and other VS Code forks?

Mostly yes. Editors built on the VS Code core — including Cursor and VSCodium — inherit the same default keybindings, so the editing, navigation, and search shortcuts here carry over. AI-specific actions add their own extra shortcuts on top.

Master a few of these each week and they quickly become muscle memory. If your team is scaling and you need experienced developers who already work fast in modern tooling, Codersera can help you hire vetted remote developers to extend your engineering team.