Visual Studio Code has become one of the most popular, if not the most popular, text editors for developers and power users. It comes packed with features shortcuts, extensions and more to cater to every developer caliber. However, like most tools, it is only as powerful as the user. This VSCode ultimate keyboard shortcuts cheatsheet will provide the most common and useful shortcuts to turn you into a Visual Studio Code power user.
Note: If you are using macOS:
- CTRL is equivalent to the ⌘ key
- SHIFT is equivalent to the ⇧ key.
- ALT is equivalent to the ⌥ key.
The following are some VSCode keyboard shortcuts you can use when working with various files in the editor.
|CTRL + O||Opens a file from the file system|
|CTRL + N||Creates a new file|
|CTRL + S||Saves the current file|
|CTRL + SHIFT + S||Enables Save As mode, which allows you to define an extension or rename a file|
|CTRL + K then S||Save All: Start by pressing CTRL + K to enable key binding mode. Then Press S to Save All.|
|CTRL + F4||Close the current open file, saving the changes|
|CTRL + K CTRL + W||Close all open files simultaneously, saving the changes|
|CTRL + SHIFT + T||Reopen closed editor window|
|CTRL + K R||Open the file location of the active file in the file system|
|CTRL + K P||Copy the full path of the active file|
|CTRL + SHIFT + F||Show the search window|
Managing the editor
The following are some VSCode keyboard shortcuts to manage the editor.
|CTRL + \||Split the editor by adding one extra editing window|
|CTRL + W||Close the current editor window|
|CTRL + K F||Close the currently opened folder and default to the main window.|
When editing files, you use the following shortcuts to make your life easier.
|CTRL + C||Copy the current line if section is highlighted|
|CTRL + X||Cut the current line if no section is highlighted|
|CTRL + F||Search in the current file|
|CTRL + H||Replace entity in the current file|
|CTRL + L||Select the current line|
|SHIFT + F3||Find previous|
|CTRL + SHIFT + K||Delete the current line without highlight|
|CTRL + U||Undo the most recent cursor operation|
|ALT + Up Arrow / Down Arrow||Move the current line up or down from the current position|
|CTRL + End||Go to the end of a file|
|CTRL + Home||Go the beginning of the file|
|ALT + RETURN||Select all occurrences of the found matches|
|CTRL + /||Comment or uncomment out the current line if no section is highlighted|
|CTRL + Return||Insert a new line below the current line|
|CTRL + SHIFT + \||Go to the matching bracket|
|CTRL + ]||Automatically indent the current line if no section is highlighted|
|CTRL + [||Automatically outdent the current line if no section is highlighted.|
|CTRL + SHIFT + ]||Uncollapse a specific region.|
|CTRL + SHIFT + [||Collapse a region|
|CTRL + ALT + F||Format the current document|
|CTRL + K CTRL + F||Format the selected section|
|CTRL + SHIFT + H||Replace in Files|
|CTRL + .||Show Quick Fix actions, if one is available|
|CTRL + K M||Alter the current file language and set to auto-detect by default|
|CTRL + SPACE||Manually activate a code suggestion|
|ALT + Mouse Click||Insert a cursor|
The following VSCode keyboard shortcuts can be used to navigate the main editor.
|CTRL + SHIFT + P||Launch the Command Palette|
|CTRL + ,||Open the user settings|
|CTRL + K CTRL + S||Launch Keyboard shortcut interface.|
|CTRL + SHIFT + N||Open a new window|
|CTRL + SHIFT + W||Close the window|
|CTRL + Mouse Click||Open the link on the default browser|
To quickly navigate through your files, use the following VSCode keyboard shortcuts.
|CTRL + T||Quickly toggle all symbols|
|CTRL + P||Go to a specific file or use the > to launch the command palette|
|CTRL + SHIFT + O||Navigate to a specific symbol|
|F11||Enable full screen mode|
|CTRL + SHIFT + E||Toggle Explorer/Editor Focus|
|CTRL + SHIFT + X||Show/Search Visual studio extensions|
|CTRL + SHIFT + D||Show the Debug panel|
|CTRL + =/||Adjust zoom level|
Visual Studio Code comes with an integrated terminal environment. You can use the following keyboard shortcuts to navigate it.
|CTRL + `||Open a new terminal session|
|CTRL + C||Copy the highlighted section|
|CTRL + V||Paste into the active terminal session|
|CTRL + Up Arrow||Scroll Up in the active terminal|
|CTRL + Down Arrow||Scroll down active terminal|
|CTRL + Home||Navigate to top|
|CTRL + End||Scroll to bottom|
In this VSCode keyboard shortcuts cheatsheet, we provided popular and useful shortcuts for the Visual Studio Code editor. It is good to note that the above are only highlights of the most useful shortcuts. You can view all other keyboard bindings using the CTRL + K CTRL + S shortcut.