Easy VS Code shortcuts that improve code speed

Micro investments for macro productivity returns

You write code everyday, and there are probably a million small tasks that you do repeatedly on a daily basis. These basic editing VS code shortcuts have proved to increase my coding speed with the small tasks, leaving my cognitive space free for more thought provoking tasks.

This list compiles the most easy to learn shortcuts.

Delete line

Cmd Shift K
Ctrl Shift K

Deletes the entire line without needing to delete whitespaces and line break manually. You do not need to select the entire line, just having cursor on the line is enough. If you want to delete a line block instead, select all the lines, again you don’t need to select the entire text, as long as your selection spreads on all the target lines, this shortcut works.


Move line

Option /
Alt /

Moves a line relative to other lines, mouse not needed whatsoever. This helps a great deal when reordering CSS properties, or moving a block of code inside a condition.


Clone line

Shift Option /
Shift Alt /

Makes a copy of a line above or below it. Neat trick to make temporary changes while debugging.


Rename symbol

F2

or Right click -> Rename Symbol

Renames all the occurences of a variable / function name by changing it in one place.


Cut Copy Paste lines

Cmd X / C / V
Ctrl X / C / V

The most commonly used shortcuts, but did you know with VSCode you don’t need to select the entire line to perform these? Just put your cursor on the target line and these work.


Using these shortcuts from muscle memory

When you start using these shortcuts initially, you will notice you need to look them up which is actually slowing you down. This is natural as it is with learning anything new. When you have done it enough times the shortcuts will be second nature and the speed will show!

Do you use any shortcuts that make you blazing fast? Share them with me.

Bhargav Shah
Bhargav Shah
Front End Developer

I’m passionate about writing code that makes user lives easier.

Related