10 Visual Studio Code Shortcuts to Master
10 Visual Studio Code shortcuts for Windows, Mac, and Linux
Productivity and speed are important when developing software. Visual Studio Code (VS Code) has a lot of shortcuts to help you with just that. Shortcuts allow you to quickly run tasks that you frequently do without letting your hands off the keyboard.
Here is a selection of some of the most widely used VS Code shortcuts. I hope they help you become more productive as you develop software in VS Code.
1. Comment code selection
Comments are important in making our code more readable. The shortcut below works both for commenting and uncommenting a code selection. Simply highlight the code you want to comment or uncomment and press the shortcut below.
Windows & Linux:
Ctrl + /
Mac:
Cmd + /

2. Find and replace
Refactoring code is of vital importance when developing software. If there are several instances of a word or words that you want to replace within a file then you should use the Find and replace shortcut.
Windows & Linux:
Ctrl + H
Mac:
Cmd + Shift + H
Note for the Mac, the shortcut I have provided will search in all files.
3. Open a console terminal
Visual Studio Code allows you to run commands from within the IDE. This is handy when you want to quickly run commands, scaffold code, or spin up a development server. Use the shortcut below to open a terminal console in VS Code.
Windows, Mac & Linux:
Ctrl + `
4. Split the console terminal window
In addition to the shortcut above, VS Code takes it a step further by allowing you to open several terminal windows running side by side. To split your console windows simply use the shortcut below.
Windows, Mac & Linux:
Ctrl + Shift + 5
Note your mouse cursor must be in the terminal console when executing this shortcut.

5. Toggle the sidebar
Sometimes you just want to focus more on code and have a larger workspace. One way of achieving this is to toggle the sidebar. To collapse the sidebar simply use the shortcut below. Use the same shortcut to bring back the sidebar.
Windows & Linux:
Ctrl + B
Mac:
Cmd + B

6. Go to line
To quickly go to a specific line of code within a file. You can use the Go to line shortcut as below.
Windows, Mac & Linux:
Ctrl + G
7. Open a file
To quickly open a specific file, you can easily find it via the open file palette. Simply press the shortcut below and start typing the name of the file you are looking for.
Windows & Linux:
Ctrl + P
Mac:
Cmd + P
8. Open a command palette
The command palette is very versatile. It allows you to run quick commands, for example to login to Azure or build projects. The command palette can also be used to search for shortcuts by name.
Windows & Linux:
Ctrl + Shift + P
Mac:
Cmd + Shift + P
9. Open settings
VS Code is highly customizable. For example, you can easily change key bindings or other settings to suit your preferences. To open the setting panel simply use the shortcut below.
Windows & Linux:
Ctrl + ,
Mac:
Cmd + ,
10. Open a new instance of VS Code
Last but not least. VS Code allows you to open a new instance of VS Code when you are in another VS Code window. Simply use the shortcut below.
Windows & Linux:
Ctrl + Shift + N
Mac:
Cmd + shift + N

Conclusion
Productivity is key when developing software. Whenever you find that you are doing some task over and over again. It is wise to check if there is a shortcut for it. With time, you will master the shortcuts that you use often.
For more VS Code shortcuts, take a look at a comprehensive cheat-sheet here.