Visual Studio Code (VSCode) has become one of the most popular text editors among developers and power users. It comes packed with features, shortcuts, plugins, and more to meet every developer's needs. However, like most tools, it's only as powerful as the user. Here are VSCode keyboard shortcuts.
By default, VSCode already provides a set of keyboard shortcuts that can control virtually every aspect of the text editor. For example, the program provides a way to switch its user interface and enable its "rich languages" feature. However, one of VSCode's major limitations is the lack of a clear way to see which shortcuts are available within the program.
Fortunately, this Ultimate VSCode Keyboard Shortcuts Sheet will provide you with the most common and useful shortcuts to turn you into a Visual Studio Code power user.
VSCode Keyboard Shortcuts
Windows | Linux | Mac | Occupation |
---|---|---|---|
Files management | |||
Ctrl + O | Ctrl + O | cmd + O | Opens a file from the file system. |
Ctrl + N | Ctrl + N | Cmd+N | Creates a new file. |
Ctrl + S | Ctrl + S | Cmd+S | Saves the current file. |
Ctrl + Shift + S | Ctrl + Shift + S | Cmd + Shift + S | Enables Save As mode, which allows you to define an extension or rename a file. |
Ctrl + K, then S | Cmd + Option + S | Save all. | |
Ctrl + F4 | Ctrl + W | Cmd+W | Close the currently open file, and save the changes. |
Ctrl + K, then Ctrl + W | Ctrl + K, then Ctrl + W | Cmd + K, then Cmd + W | Close all open files at once, saving changes. |
Ctrl + Shift + T | Ctrl + Shift + T | Cmd + Shift + T | Reopen the closed editor window. |
Ctrl + K, then R | Ctrl + K, then R | Cmd + K, then R | Open the location of the active file in the file system. |
Ctrl + K, then P | Ctrl + K, then P | Cmd + K, then P | Full path to the active file. |
Ctrl + Shift + F | Ctrl + Shift + F | Cmd + Shift + F | Show search window. |
Editor's Management | |||
Ctrl + Backslash (\) | Ctrl + Backslash (\) | Cmd + Backslash (\) | Split the editor by adding an additional editing window. |
Ctrl + W | Ctrl + W | Cmd+W | Close the current editor window. |
Ctrl + K, then F | Ctrl + K, then F | Cmd + K, then F | Close the currently open folder and default to the main window. |
Alt + Z | Alt + Z | Option + Z | Enable or disable word wrapping in the current file. |
Ctrl + Shift + U | Ctrl + K, then Ctrl + H | Cmd + Shift + U | Toggle VSCode output window. |
Ctrl + K, then Z | Ctrl + K, then Z | Cmd + K, then Z | Toggle VSCode's Zen Mode. |
Edit files | |||
Ctrl + C | Ctrl + C | Command + C | Copy the current line if the section is highlighted. |
Alt + Shift + Up arrow | Copy the current line if the section is highlighted. | Copy the line above the current line. | |
Alt + Shift + Down arrow | Replace the entity in the current file. | Copy the line below the current line. | |
Ctrl + X | Ctrl + X | Command + X | Cut the current line if no section is highlighted. |
Ctrl + F | Ctrl + F | Cmd+F | Search the current file. |
Ctrl + H | Ctrl + H | Cmd+Option+F | Replace the entity in the current file. |
Ctrl + L | Ctrl + L | Cmd+L | Select the current line. |
Ctrl+Shift+L | Ctrl+Shift+L | Cmd + Shift + L | Select all instances of the current line in the file. |
F3 | F3 | Cmd+G | Search for the following. |
Shift + F3 | Shift + F3 | Cmd + Shift + G | Find the previous one. |
Ctrl + Shift + K | Ctrl + Shift + K | Cmd + Shift + K | Move the current formation from the current position. |
Ctrl + U | Ctrl + U | Cmd+U | Undo the most recent index operation. |
Alt + Up Arrow | Alt + Up Arrow | Option + Up Arrow | Move the current line up from its current position. |
Alt + Down Arrow | Alt + Down Arrow | Option + Down Arrow | Move the current line down from the current position. |
End | End | End | Move to the end of the current line. Home Home Home Go to the beginning of the file. |
Home | Home | Home | Go to the beginning of the file. |
Ctrl + End | Ctrl + End | Cmd + Down Arrow | Go to the end of the file. |
Ctrl + Home | Ctrl + Home | Cmd + Up Arrow | Go to the beginning of the file. |
Alt + Enter | Alt + Enter | Option + Enter | Select all duplicates found. |
Ctrl + Enter | Ctrl + Enter | Cmd+Enter | Insert a new line below the current line. |
Ctrl + Shift + Enter | Ctrl + Shift + Enter | Cmd + Shift + Enter | Insert a new line above the current line. |
Ctrl + Shift + Backslash (\) | Ctrl + Shift + Backslash (\) | Cmd + Shift + Backslash (\) | Go to the matching slide. |
Ctrl + Right Square Bracket (]) | Ctrl + Right Square Bracket (]) | Cmd + Right Square Bracket (]) | Automatically indent the current line if no section is highlighted. |
Ctrl + Left Square Bracket ([) | Ctrl + Left Square Bracket ([) | Cmd + Left Square Bracket ([) | Automatically move the current line if no section is highlighted. |
Alt+Shift+F | Ctrl + Shift + I | Option + Shift + I | Current document format. |
Ctrl + K, then Ctrl + F | Ctrl + K, then Ctrl + F | Cmd + K, then Cmd + F | Format the selected section. |
Ctrl+Shift+H | Ctrl+Shift+H | Cmd + Shift + H | Replace in files. |
Ctrl + Period (.) | Ctrl + Period (.) | and Cmd + Period (.) | Show quick fix actions, if one is available. |
Ctrl + K, then M | Ctrl + K, then M | Cmd + K, then M | Modify the current file language and set it to auto-detect by default. |
Ctrl + K, then Ctrl + X | Ctrl + K, then Ctrl + X | Cmd + K, then Cmd + X | Remove all extra spaces and tabs in the document. |
Ctrl + Space | Ctrl + Space | Ctrl + Space | Manually activate code suggestion. |
Alt + Left Mouse Click | Alt + Left Mouse Click | Option + Left Mouse Click | Enter the cursor. |
Comment code | |||
Ctrl + Slash (/) | Ctrl + Slash (/) | Cmd + Slash (/) | Comment or uncomment the current line. |
Ctrl + K, then Ctrl + C | Ctrl + K, then Ctrl + C | Cmd + K, then Cmd + C | Create a comment on the current line. |
Ctrl + K, then Ctrl + U | Ctrl + K, then Ctrl + U | Cmd + K, then Cmd + U | Remove a comment on the current line. |
Alt+Shift+A | Ctrl + Shift + A | Option + Shift + A | Comment or uncomment outside the current selection area. |
Job definitions | |||
F12 | F12 | F12 | Open the library definition for the current function. |
Ctrl + K, then F12 | Ctrl + K, then F12 | Cmd + K, then F12 | Open a new window containing the library definition for the current function. |
Alt + F12 | Ctrl+Shift+F10 | Option+F12 | Open a small window displaying the library definition for the current function. |
Shift + F12 | Shift + F12 | Shift + F12 | Find all jobs in the project that reference the current job. |
F2 | F2 | F2 | Rename the current job. |
Ctrl + F2 | Ctrl + F2 | Rename the current function and replace all instances of it in the file. | |
sir | |||
Ctrl + Shift + P | Ctrl + Shift + P | Cmd + Shift + P | Turn on the dashboard. |
Ctrl + Comma (,) | Ctrl + Comma (,) | Cmd + Comma (,) | Open user settings. |
Ctrl + K, then Ctrl + S | Ctrl + K, then Ctrl + S | Cmd + K, then Cmd + S | Turn on the keyboard shortcut interface. |
Ctrl + Shift + N | Ctrl + Shift + N | Cmd + Shift + N | Open a new window. |
Ctrl + Shift + W | Ctrl + W | Cmd+W | Close the window. |
Ctrl + Left Mouse Click | Ctrl + Left Mouse Click | Open the link in your default browser. | |
Browse VSCode | |||
Ctrl + T | Ctrl + T | cmd + T | Swap all icons quickly. |
Ctrl + P | Ctrl + P | Cmd+P | Go to a specific file. |
Ctrl+Shift+O | Ctrl+Shift+O | Cmd + Shift + O | Jump to a specific symbol. |
F11 | F11 | Cmd+Ctrl+F | Enable full screen mode. |
Ctrl+Shift+E | Ctrl+Shift+E | Cmd + Shift + E | Switch focus to explorer/editor. |
Ctrl+Shift+X | Ctrl+Shift+X | Cmd+Shift+X | Show/Search Visual Studio Extensions. |
Ctrl + Shift + D | Ctrl + Shift + D | Cmd + Shift + D | Display the correction panel. |
Ctrl + Equal (=) | Ctrl + Equal (=) | Cmd + Equal (=) | Zoom in on the VSCode interface. |
Ctrl + Minus (-) | Ctrl + Minus (-) | Cmd + Shift + Minus (-) | Minimize the VSCode interface. |
Ctrl + Shift + Left Square Bracket ([) | Option + Shift + Left Square Bracket ([) | Hide the current area of code. | |
Ctrl + Shift + Right Square Bracket (]) | Option + Shift + Right Square Bracket (]) | Show the current area of the code. | |
Ctrl + K, then Ctrl + 0 | Ctrl + K, then Ctrl + 0 | Cmd + K, then Cmd + 0 | Hide all areas in the currently open file. |
Ctrl + K, then Ctrl + J | Ctrl + K, then Ctrl + J | Cmd + K, then Cmd + J | Show all areas in the currently open file. |
Ctrl + K, then Ctrl + Left Square Bracket ([) | Cmd + K, then Cmd + Left Square Bracket ([) | Hide all subareas in the currently open file. | |
Ctrl + K, then Ctrl + Right Square Bracket (]) | Cmd + K, then Cmd + Right Square Bracket (]) | Show all subregions in the currently open file. | |
Terminal mode | |||
Ctrl + Backtick (`) | Ctrl + Backtick (`) | Ctrl + Backtick (`) | Open the station. |
Ctrl + Shift + Backtick (`) | Ctrl + Shift + Backtick (`) | and Ctrl + Shift + Backtick (`) | Create a new terminal instance. |
Ctrl + C | Ctrl + Shift + C | Command + C | Copy the highlighted section. |
Ctrl + V | Ctrl + Shift + V | Paste into the active terminal session. | |
Ctrl + Up Arrow | Ctrl + Shift + Up Arrow | Cmd + Up Arrow | Scroll up on the active station. |
Ctrl + Shift + Down Arrow | Ctrl + Shift + Down Arrow | Cmd + Down Arrow | Go to top. |
Ctrl + Home | Ctrl + Home | Cmd + Home | Go to top. |
Ctrl + End | Ctrl + End | Cmd + End | Scroll down. |
debug mode | |||
F9 | F9 | F9 | Create a breakpoint at the currently selected line. |
F5 | F5 | F5 | Run the code one step past the breakpoint. |
F11 | F11 | F11 | Go inside the child function or loop. |
Shift + F11 | Shift + F11 | Shift + F11 | Go outside either the child function or the loop. |
F10 | F10 | F10 | Skip execution on current breakpoint. |
F8 | F8 | F8 | Move the cursor to the next error in the file. |
Shift + F8 | Shift + F8 | Shift + F8 | Move the point to the previous error in the file. |
Shift + F5 | Shift + F5 | Shift + F5 | Stop the correction session. |