20 USEFUL VS CODE KEYBOARD SHORTCUT

20 USEFUL VS CODE KEYBOARD SHORTCUT

As developers, we use our mouse frequently and study has shown that assuming we work for 8 hours a day on our system we lose 64 hours a year if we use the mouse to do the work that can be done easily by our keyboard. Alarming right? 64hours that can be used to be productive elsewhere, moreover making use of a keyboard makes our code faster and more fun. Tell me who does not like some fun (smile)

This article focus on the 20 most used keyboard shortcuts for vscode. vscode (short for Visual Studio Code) is a free source-code editor made by Microsoft for Windows, Linux, and macOS.

The commands used by window users and mac users are slightly different. The window users use the control (**"ctrl"**) key that is equivalent to the **"command"** key for mac users. So let us dive into them.

tenor.gif

  1. To open and close vscode sidebar: ctrl + b

  2. To open your files: ctrl + shift + e

  3. To open the marketplace (This is where we get extensions to be installed): ctrl + shift + x

  4. Switching from one folder or project to another: ctrl + r

  5. To open terminals: ctrl + `

  6. For the quick finding of files: ctrl + p

  7. To move to a particular line in your code: ctrl + g

  8. Switching from one language to another: windows + space

  9. Moving from one tab to another (This is used when vscode screen are split): ctrl + 1, ctrl + 2. The numbering i.e 1, 2, etc depends on the number of screens it is split into.

  10. Selecting or highlighting word: ctrl + d

  11. Word Wrap (This wrap our code according to the vscode screen size): Alt + z

  12. To comment a code out ctrl +?

  13. To move quickly to the beginning/end of a file: ctrl + Home/Ctrl + End

  14. To toggle full screen: F11

  15. To reopen closed tab : ctrl + shift + t

  16. To type or edit the same code that appears in multiple lines: ctrl + alt + arrow up / ctrl + alt + arrow down

  17. To move back and forth within files that are opened: Alt + arrow front / Alt + arrow back

  18. To move a line of code to another line: Alt + arrow up / Alt + arrow down

  19. To close a particular file: ctrl + w

  20. To show more command line shortcut: ctrl + shift + p

Thanks for reading and if you find this article interesting please show me some love in the comment section and you can also repost on Twitter