← All articles
Tools1 min read

VS Code Shortcuts That Save Hours

The difference between a slow and a fast editor session is rarely typing speed — it's navigation. Here are the keybindings worth committing to muscle memory.

S

Swapnika Voora

Author

Most of the time you spend in an editor isn't typing code — it's finding it, moving around it, and manipulating existing lines. Learning a handful of VS Code shortcuts pays for itself within a day.

The command palette and quick-open are the two shortcuts to learn first. They replace almost all menu digging.

navigation
Ctrl/Cmd + P        Quick open file by name
Ctrl/Cmd + Shift+P  Command palette (run any command)
Ctrl/Cmd + P then @ Jump to symbol in the current file
Ctrl/Cmd + G        Go to line number
F12                 Go to definition
Alt/Opt + ←/→       Navigate back / forward

Editing lines fast

These operate on whole lines without selecting them first, which is faster than it sounds once it's automatic.

line editing
Alt/Opt + ↑/↓            Move line up / down
Shift + Alt/Opt + ↑/↓    Copy line up / down
Ctrl/Cmd + Shift + K     Delete line
Ctrl/Cmd + /             Toggle line comment
Ctrl/Cmd + Enter         Insert line below

Multi-cursor magic

Multiple cursors turn repetitive edits into one action.

multi-cursor
Ctrl/Cmd + D            Select next occurrence of selection
Ctrl/Cmd + Shift + L    Select all occurrences
Alt/Opt + Click         Add a cursor anywhere

Takeaways

  • Master quick-open and the command palette before anything else.
  • Line-move and line-duplicate replace a lot of select-and-drag.
  • Ctrl/Cmd + D for incremental multi-select is the highest-leverage edit key.

Open the Keyboard Shortcuts editor (Ctrl/Cmd + K Ctrl/Cmd + S) and customize the few that fight your muscle memory from other tools.

#vs-code#productivity#editor

More in Tools