VSCode keyboard shortcuts

Official reference

Command palette

Ctrl + Shift + P opens the command palette. Then, start typing some text and VSCode will suggest corresponding commands.

Example

Ctrl + Shift + P then reloa should suggest reloading the current window (Reload Window).

Move line up/down

In the editor, move up or down an entire line with:

Alt + ⬆️ ou Alt + ⬇️

Duplicate the cursor

To edit code on multiple lines at the same time :

  • Bottom : Ctrl + Shift + ⬇️
  • Up : Ctrl + Shift + ⬆️

Duplicate code block

To duplicate a code block (or a single line), select the code and press:

Alt + Shift + ⬇️

Delete a line

When the cursor is on a line, it’s possible to delete the line with:

Shift + Suppr

Comment/Uncomment code

To comment code, there are 2 ways:

  • Ctrl + :
  • Ctrl + K then Ctrl + C

To uncomment code, there are 2 ways:

  • Ctrl + :
  • Ctrl + K then Ctrl + U

Search text in the current file

To search for text in the current file:

Ctrl + F then enter text to search.

Search text in the whole project

To search for text in the entire project and not only in the current file:

Ctrl + Shift + F

There are options available, for example, to exclude specific folders, etc…

Select same text

To select the same text multiple times within the same file, first select the text, then press Ctrl + D as many times as necessary to select other instances of the same text within the file.

To select all instances of the same text within the file, use:

Ctrl + Shift + L

Open terminal

To open a terminal:

Ctrl + ù

To open a new terminal:

Ctrl + Shift + ù

Access a file from a project

Within a project, press Ctrl + P then the file name.

When the correct name is suggested by VSCode, press Enter to open it.