Cover Image for VS Code Tips

VS Code Tips

To become one with your IDE you really have to learn a fair number of key-commands. Here are some of the most important in VS Code:

Selection:

Insert cursor
⌥ click

Insert cursor above or below
⌥⌘↑ or ⌥⌘↓

Undo last cursor action
⌘U

Insert cursor at the end of each line selected
⇧⌥I

Select all occurences of current selection
⇧⌘K

Box/column selection
⇧⌥ click (& drag)

Move the box up/down/left/right
⇧⌥⌘ arrow key

Editing:

Move selected line
⌥↑ or ⌥↓

Copy line
⇧⌥↑ or ⇧⌥↓

Delete line
⇧⌘K

Insert new line below or above
⌘Enter or ⇧⌘Enter

Jump to matching bracket
⇧⌘\

Decrease or increase line indent
⌘[ or ⌘]

Jump to top or bottom of file
⌘↑ or ⌘↓

Fold or unfold region
⌥⌘[ or ⌥⌘]

Toggle comment
⌘/

Toggle comment over multiple highlighted lines
⇧⌥A

Toggle word wrap
⌥Z

General:

Show the command palette
⇧⌘P or F1

Search files by name
⌘P

Open settings
⌘,

The ultimate move: open the keyboard shortcuts
⌘K then ⌘S

Just for reference:

is the Command () key.

is the Control key.

is the Option (alt) key.

is the Shift key.