VSCode Shortcuts every programmer should know

Benazir Hamza Elayo
3 min readMay 31, 2022

--

Anything that makes life easier is worth learning. Visual Studio code is one of the most popular code editors out there, due to its flexibility and large range of features. There are several VSCode shortcuts that allows you to quickly perform a task. In this article, we will look at 10 of my favorites and what they do.

1. Ctrl + ! (for windows), cmd + ! (for mac) :

This allows you to create the html boilerplate just a shown below.

2. Ctrl F2 or cmd F2(for mac):

This allows you to edit a group of text or word in all the places it occurs in the file document.

3. Ctrl KZ or cmd KZ (for mac):

This is referred to as Zen mode. Zen mode allows you to focus solely on your code, hiding all buttons and toolbars from the view.

4. Ctrl + Shift + P(windows) or cmd + Shift + P(mac) :

This shortcut key is referred to as command palette. It allows you to open up a list of suggested shortcuts, functionalities and configuration in vscode. This would help you find a command you are looking for, without having to memorize.

5. Alt + Up/Down Arrow or opt + Up/Down Arrow( for mac) :

This allows you to move a line of code up or down. Use up arrow to move up, and down arrow to go down. The last link below was moved down.

6. Ctrl + shift + k or cmd + shift + k (for mac):

This key allows you to delete a line of code without having to select all text on the line.

7. Shift + alt + down/up or Shift + opt + down/up (for mac) :

This is helpful when you want to add more than one line of the same or very similar code. It copies the code in the current line and pastes it down or up continuously as you desire, just as shown below.

8. Ctrl g: This navigates you to a specific line. On typing this, a command palette pops up & you just have to type in the line number. This is very helpful instead of scrolling through lines especially if your file is large.

9. Ctrl = or cmd = (for mac) :

allows you to zoom in, while Ctrl — allows you to zoom out

10. Ctrl T or Cmd T (for mac): this allows you to find a class, function or variable in a file document.

Thank you for reading this. I hope you start using shortcut keys to make coding faster!

Love as always,

Benazir.

--

--

Benazir Hamza Elayo

Cloud | Writer | Researcher | Constantly unlearning and relearning