Keyboard shortcuts essential in Visual Studio Code
By
Darío Rivera
Posted On
in
Visual Studio Code
In another article we saw some of the most important settings of Visual Studio code after installation. In this post, we will see a complement which are the most important shortcuts that you should know to better navigate the editor.
Global
Shortcut | Description |
Ctrl+Shift+P, F1 | Access to all commands and shortcuts |
Ctrl+, | User settings |
Side Bar
These shortcuts access the options in the side bar.
Shortcut | Description |
Ctrl+B | Show/Hide side bar |
Ctrl+Shift+F | Open search panel |
Ctrl+Shift+G | Open version control system |
Ctrl+Shift+G | Open run and debug panel |
Ctrl+Shift+X | Open extensions panel |
Text Editing
Shortcut | Description |
Ctrl+K Ctrl+C | Comment/uncomment current line or selection |
Ctrl+K Ctrl+U | Uncomment current line or selection |
Ctrl+/ | Comment/uncomment current line or selection |
Ctrl+K Ctrl+F | Format selection |
Ctrl+Shift+K | Delete line |
Search and Replace
Shortcut | Description |
Ctrl+F | Search for text |
Ctrl+H | Replace text |
Ctrl+F3 | Find next occurrence (on a word or selection) |
Ctrl+Shift+F3 | Find previous occurrence (on a word or selection) |
Selection
Shortcut | Description |
Ctrl+L | Select current line |
Ctrl+Shift+L | Select all occurrences - multicursor (on a word or selection) |
Following are some examples of these shortcuts.
Ctrl + Shift + LNavigation
Shortcut | Description |
Ctrl+P | Go to file |
F12 | Go to definition (function, class, etc) |
Shift+F12 | Show references (usages in the whole project) |
Ctrl+K F12 | Open definition in another panel |
Ctrl+Shift+F10 | Peek definition |
Following are some examples of these shortcuts.
Shift + F12Ctrl + K F12
Modes
Shortcut | Description |
Ctrl+K M | Select language (mode) |