VS Code Shortcuts

VS Code keyboard shortcuts.

The VS Code shortcuts that matter — navigation, multi-cursor editing, find & replace. Mac and Windows.

Navigation
Command Palette++PCtrl+Shift+PCtrl+Shift+P
Quick Open file+PCtrl+PCtrl+P
Go to line+GCtrl+GCtrl+G
Go to symbol++OCtrl+Shift+OCtrl+Shift+O
Go to definitionF12F12F12
Toggle sidebar+BCtrl+BCtrl+B
Toggle terminal+`Ctrl+`Ctrl+`
Editing
Comment line+/Ctrl+/Ctrl+/
Move line up/down+↑/↓Alt+↑/↓Alt+↑/↓
Copy line up/down++↑/↓Shift+Alt+↑/↓Shift+Alt+↑/↓
Delete line++KCtrl+Shift+KCtrl+Shift+K
Select next occurrence+DCtrl+DCtrl+D
Format document++FShift+Alt+FCtrl++I
Rename symbolF2F2F2
Find & files
Find+FCtrl+FCtrl+F
Replace++FCtrl+HCtrl+H
Find in all files++FCtrl+Shift+FCtrl+Shift+F
Save+SCtrl+SCtrl+S
Split editor+\Ctrl+\Ctrl+\
Settings+,Ctrl+,Ctrl+,
On Linux, VS Code uses the same shortcuts as Windows (Ctrl-based); the main difference is Format Document, which is Ctrl + Shift + I.

The Command Palette is the master key

If you learn one VS Code shortcut, make it the Command Palette (⌘/Ctrl + Shift + P). Almost everything the editor can do — changing language mode, running a task, installing an extension, reformatting a file, toggling a setting — is reachable by typing a few letters there. It means you never have to remember where a command lives in the menus; you just describe what you want. Many experienced developers run most of their non-typing actions through it rather than hunting through panels.

Move around without the mouse

The next tier is navigation. Quick Open (⌘/Ctrl + P) jumps to any file by name in a couple of keystrokes, which beats clicking through the file tree once a project grows. Go to Symbol and Go to Line get you to the exact spot you need, and Go to Definition (F12) follows a function or variable to where it's defined — essential for reading unfamiliar code. Toggling the integrated terminal (Ctrl + backtick) keeps your commands and your code in one window.

Multi-cursor is the superpower

VS Code's multi-cursor editing is what makes people who use it look impossibly fast. Add a cursor on the next matching word with ⌘/Ctrl + D and you can rename five occurrences of a variable at once; Alt + Click drops cursors anywhere you like. Combine that with line actions — move a line up or down with Alt + ↑/↓, duplicate it with Shift + Alt + ↓, comment it with ⌘/Ctrl + /, and rename a symbol everywhere with F2 — and routine edits that would take a dozen mouse moves collapse into a single gesture.

How to adopt them

Add one shortcut at a time. Start with the Command Palette and Quick Open this week; bring in multi-cursor next. Press / to search this page when you forget one. Since VS Code shares its clipboard and editing keys with the rest of your system, the general shortcuts reinforce each other, and the Git commands pair naturally with VS Code's built-in source control.

FAQ

What is the VS Code Command Palette shortcut?
Press Command + Shift + P on Mac or Ctrl + Shift + P on Windows to open the Command Palette, which runs any VS Code command.
How do I add multiple cursors?
Press Command/Ctrl + D to select the next occurrence of the current word, adding a cursor at each. Or Alt-click to place cursors manually.

Related