My favorite VS keyboard shortcuts

June 3, 2024 | Article

Image of VS code icon.

Technology

Why shortcuts?

At one of my previous jobs, I had to manually process large Excel files, usually well over 5,000 rows. This "processing" meant meticulously scanning rows for specific items and copying them to another file. While the task wasn't particularly difficult, it certainly wasn't engaging either.

To combat the tedium, I challenged myself to complete as much work as possible without touching the mouse. This included creating tables, selecting columns, setting and clearing filters, and performing various copy-paste operations.

The value of this skill became evident when I ever I watch someone slowly drag their mouse to select rows, miss something, and then have to start all over again.

Since then, I've made it a priority to learn the keyboard shortcuts for software I use often. My method is simple and perhaps old-fashioned, but it works: I add sticky notes to the bottom of my monitor. Before reaching for the mouse, I pause to check my notes for the relevant shortcut. If I don't have it documented, I look it up and add it to the collection.

Image of my monitor with sticky notes of keyboard shortcuts.
My keyboard shortcut sticky notes

Today, I'd like to share some of the most useful VS Code shortcuts I've collected. While many shortcuts are consistent across platforms (with Command substituting for Control on Mac, and Option for Alt), some variations exist. I've noted platform-specific differences where applicable.

Moving the cursor faster

Move the cursor word by word

Jump to line end/start

Windows: Home / End

  • macOS: Cmd + ← →

Jump to file end/start

  • Windows: Ctrl + Home / Ctrl + end
  • macOS: Cmd + Up / Down

Move to enclosing brackets: Ctrl + Shift + \

Move to specific line: Ctrl + G

Making Selections

Expand selection character by character: Shift + ← / →

Expand selection word by word: Alt + Shift + ← / →

Select entire word. Press again to select next occurrence: Ctrl + D

Select entire line. Press again to select next line: Ctrl + L,

Select all occurrences of a word in file: Ctrl + Shift + L

Box select. Press escape to get rid of multiple cursors: Ctrl + Alt + Shift + Arrow keys

Alt + ← / → Go backward and forward

F12 Go to definition

Ctrl + 1, 2, 3 Split screen

Ctrl + page up/ down switch between split screens

Ctrl + tab switch between tabs in the same pane

Ctrl Alt < > move tab over to other tab

Ctrl + B Toggle side bar

Ctrl P

Manipulation

Alt + Shift + I add cursor to each line selected

Ctrl + Alt + Up/Down Add cursor

Shift + Alt + Up down Duplicate line

Alt + up down Move line

Ctrl Shift K Delete line

Misc

Switch Projects

Ctrl + r (the actual control on mac)

Ctrl + . quick actions

Command Palette

Ctrl + Shift + P Open command palette

command pallete

@ symbols

whole project