Hello ๐ Developer
Keyboard shortcuts can tremendously improve your coding efficiency. But not every one knows about these shortcuts. So I have decided to list the most essential shortcuts in this article. Make sure to get comfortable with them.
Table of Contents
Absolute Essentials
These are the most essential shortcuts that you will find useful everywhere. Most of these shortcuts want you to select the code before you work on. Just assume that every shortcut that specifically targets something need you to select it before using the shortcut key.
Action | Shortcut |
Copying lines up | Shift + Alt + Up |
Copying lines down | Shift + Alt + Down |
Move lines up | Alt + Up |
Move lines down | Alt + Down |
Multiple Cursors | Alt + Click |
Commenting a single line | Ctrl + / |
Commenting multiple lines | Ctrl + Shift + A |
Renaming a Variable or Function | F2 |
Quick fix | Ctrl + . |
IntelliSense Suggestions | Ctrl + Space |
Auto formatting code | Shift + Alt + F |
Toggle terminal | Ctrl + J |
Toggle sidebar | Ctrl + B |
Toggle sidebar File Explorer | Ctrl + Shift + E |
Go to Definition | F12 |
Go to Reference | Shift + F12 |
Command Palette ๐จ
The command palette in VS Code lets you do many things. Once you have mastered this you can work with ease in any language. The command palette can also help you work with GitHub once you are familiar with it. As you know GitHub is the most essential thing every developer should be comfortable with. I also plan on posting an article about how easy it can be to learn to work with GitHub using VS Code.
Shortcut
F1
or Ctrl+Shift+P
Opening files
When working on a project you will need to work with multiple files simultaneously. You will be wasting a lot of time if you choose to search it using the File Explorer. It can easily be achieved using the Command Palette just open Command Palette using F1
and delete the >
character. The dialog box will show you the list of available files with in the current folder ๐ and you can open any file you wish.
Conclusion
There are still many more shortcuts and features hiding within VS Code, but they are not something that you would use in your daily developer life. Hope you make the most of these shortcuts. Comment down your thoughts about this post ๐ฏ. If you think ๐ค I have missed anything please let me know in the comments and I will surely consider it.
Thanks for your time ๐
P.S This post is more of a cheat sheet than of a article, cause I dont want to dilute this unnecessary explanations ๐ . Hope you find it useful.