23 lesser known VS Code Shortcuts as GIF

Despite many shortcuts I’m using frequently in VS Code, the following ones can come in very handy but I’m often forgetting they even exist. I made some GIFs for visualization to better remember them. Maybe there are some shortcuts you didn’t remember either but are useful for you.

Every command in VS Code can also be executed via command prompt with ++ and a search query. But knowing the direct shortcut might be faster.

I use VS Code on Windows in the GIFs, but I also provide the shortcuts for both Windows and Mac for each command.

1. + = Open user settings

Windows: +
Mac: +

Once in a while I need to adjust my user preferences, this is how you open them directly.

2. + + = Show shortcuts

Windows: + +
Mac: + +

This is the complete list of shortcuts in VS Code. There is also a VS Code Shortcuts Cheat-Sheet [PDF] available to download.

3. + = Switch workspace

Windows: +
Mac: +

This opens a list of your recent workspaces and is a super fast way to switch to another folder or project. Note that this will kill you current terminal session, if you had a terminal open in your VS Code workspace.

4. + = Toggle word wrap

Windows: +
Mac: +

A handy little helper when you quickly want to see complete lines without scrolling horizontally.

5. + = Go to line

Windows: +
Mac: +

This is the shortcut for typing + .

6. + = Go to file

Windows: +
Mac: +

The fastest way to switch files (especially when they are not already open) without using the mouse.

7. = Go to next error or warning

Windows:
Mac:

This is debugging with a single key. You can also go to previous errors or warnings using +.

8. + = Switch tabs

Windows: +
Mac: +

The fastest way to switch already open files without using the mouse.

9. ++ = Insert cursor at end of each line selected

Windows: ++
Mac: ++

This is useful for a quick creation of multiple cursors in the selected area.

10. + = Select current line

Windows: +
Mac: +

Use this i.e. to search for identical lines in combination with the next shortcut.

11. ++ = Select all occurrences of current selection

Windows: ++
Mac: ++

This shortcut really saves time because you don’t have to + through a whole file.

12. + = Select all occurrences of current word

Windows: +
Mac: +

With this you don’t even have to select something anymore. Just place the cursor on the word you want to select all occurrences of.

13. ++ = Trigger parameter hints

Windows: ++
Mac: ++

In case you don’t remember parameter order and don’t want to interrupt your flow by looking into the docs.

14. ++ = Format document

Windows: ++
Mac: ++

Because nobody wants to format a whole file manually.

15. + + = Format selection

Windows: + +
Mac: + +

In case you want to format only some parts of a file.

16. = Go to Definition

Windows:
Mac:

The quick way to jump to the definition of a variable or function.

17. + = Peek Definition

Windows: +
Mac: +

This just shows the corresponding definition of a variable or function without moving the cursor.

18. = Rename Symbol

Windows:
Mac:

An indispensible shortcut for refactoring code.

19. + + = Trim trailing whitespace

Windows: + +
Mac: + +

This is especially useful for multi-line selections.

20. + = Reveal active file in Explorer

Windows: +
Mac: +

In case you want to perform some actions out of your systems file manager instead of VS Code.

21. ++ = Replace in files

Windows: ++
Mac: ++

If only one file at a time isn’t enough for you.

22. + = Open preview to the side (i.e. Markdown)

Windows: +
Mac: +

This way you don’t have to switch to the mouse to open a preview.

23. + = Enter Zen Mode

Windows: +
Mac: +

Instantly coding distraction free. To exit Zen mode, hit .

So that’s it for now. I maintain a repository on GitHub, where I collect commands I tend to forget — check it out if you want:

Happy Coding!

Edited: 8th January 2019 (add MacOS shortcuts)
Originally published: 7th January 2019 on dev.to
Cover Image:
https://codepen.io/devmount/full/ExaQjdm

creator. developer. consultant.