Contents
ChatGPT – Here are 50 of the most commonly used shortcut keys in Visual Studio Code:
Ctrl + P (Cmd + P on macOS): Quick Open – Open file by name.
Ctrl + Shift + P (Cmd + Shift + P on macOS): Show Command Palette – Access all commands and features.
Ctrl + `(Cmd + ` on macOS)
: Toggle Terminal – Open or close the integrated terminal.
Ctrl + B (Cmd + B on macOS): Toggle Sidebar – Show or hide the sidebar.
Ctrl + Shift + E (Cmd + Shift + E on macOS): Focus on Explorer – Focus on the file explorer sidebar.
Ctrl + Shift + F (Cmd + Shift + F on macOS): Search in Files – Search for a string or regular expression in all files.
Ctrl + Shift + G (Cmd + Shift + G on macOS): Focus on Source Control – Focus on the source control sidebar.
Ctrl + Shift + D (Cmd + Shift + D on macOS): Focus on Debug – Focus on the debugging sidebar.
Ctrl + K, S (Cmd + K, S on macOS): Save All – Save all open files.
Ctrl + W (Cmd + W on macOS): Close Editor – Close the active editor tab.
Ctrl + Tab (Cmd + Tab on macOS): Switch between Editor Tabs – Cycle through open editor tabs.
Ctrl + Shift + Tab (Cmd + Shift + Tab on macOS): Move Backward through Editor Tabs.
Ctrl + \ (Cmd + \ on macOS): Split Editor – Split the active editor into two panes.
Ctrl + K, Ctrl + \ (Cmd + K, Cmd + \ on macOS): Split Editor Down – Split the active editor into two panes vertically.
Ctrl + K, Ctrl + Shift + \ (Cmd + K, Cmd + Shift + \ on macOS): Split Editor Right – Split the active editor into two panes horizontally.
Ctrl + Shift + O (Cmd + Shift + O on macOS): Go to Symbol – Navigate to a symbol in the current file.
Ctrl + G (Cmd + G on macOS): Go to Line – Jump to a specific line in the current file.
Ctrl + F (Cmd + F on macOS): Find – Search for a string in the current file.
Ctrl + H (Cmd + H on macOS): Replace – Find and replace a string in the current file.
Ctrl + Shift + F (Cmd + Option + F on macOS): Find in Files – Search for a string in all files within a directory.
Ctrl + / (Cmd + / on macOS): Toggle Line Comment – Comment or uncomment a line or block of code.
Ctrl + Enter (Cmd + Enter on macOS): Insert Line Below – Insert a new line below the current line.
Ctrl + Shift + Enter (Cmd + Shift + Enter on macOS): Insert Line Above – Insert a new line above the current line.
Ctrl + Shift + K (Cmd + Shift + K on macOS): Delete Line – Delete the current line.
Alt + รขโ โ / รขโ โ (Option + รขโ โ / รขโ โ on macOS): Move Line Up / Down – Move the current line up or down.
Alt + Shift + รขโ โ (Option + Shift + รขโ โ on macOS): Copy Line Down – Duplicate the current line below.
Ctrl + D (Cmd + D on macOS): Add Selection to Next Find Match – Select the next occurrence of the current word.
Ctrl + Shift + L (Cmd + Shift + L on macOS): Select All Occurrences of Find Match – Select all occurrences of the current word in the file.
Alt + Shift + F (Option + Shift + F on macOS): Format Document – Format the current document according to the configured formatting rules.
Ctrl + Space (Cmd + Space on macOS): Trigger Suggest – Trigger IntelliSense suggestions for code completion.
Ctrl + Shift + Space (Cmd + Shift + Space on macOS): Trigger Parameter Hints – Display parameter hints for the current method or function call.
Ctrl + . (Cmd + . on macOS): Quick Fix – Display quick fixes and suggestions for code issues.
Alt + Shift + รขโ โ / รขโ โ (Option + Shift + รขโ โ / รขโ โ on macOS): Copy Line Up / Down – Copy the current line and paste it above or below.
Shift + Alt + รขโ โ / รขโ โ (Shift + Option + รขโ โ / รขโ โ on macOS): Insert Cursor Above / Below – Insert an additional cursor above or below the current cursor position.
Ctrl + Shift + Alt + รขโ โ / รขโ โ (Cmd + Option + Shift + รขโ โ / รขโ โ on macOS): Insert Cursor Above / Below with Box Selection – Insert an additional cursor above or below with box selection.
Ctrl + Shift + M (Cmd + Shift + M on macOS): Toggle Error / Warning Messages – Show or hide the problems panel.
Ctrl + J (Cmd + J on macOS): Toggle Panel – Show or hide the panel at the bottom of the window.
Ctrl + Shift + U (Cmd + Shift + U on macOS): Toggle Output Panel – Show or hide the output panel.
Ctrl + K, Ctrl + X (Cmd + K, Cmd + X on macOS): Trim Trailing Whitespace – Remove trailing whitespace from the current file.
Ctrl + K, M (Cmd + K, M on macOS): Change Language Mode – Change the language mode for the current file.
Ctrl + K, Ctrl + I (Cmd + K, Cmd + I on macOS): Show Hover – Display hover information for the current symbol.
Ctrl + K, V (Cmd + K, V on macOS): Markdown Preview – Open a preview of the current Markdown file.
Ctrl + Shift + V (Cmd + Shift + V on macOS): Markdown Preview to Side – Open a preview of the current Markdown file in a side-by-side view.
Ctrl + K, R (Cmd + K, R on macOS): Reveal Active File in Explorer – Navigate to the active file in the file explorer sidebar.
Ctrl + K, O (Cmd + K, O on macOS): Show Opened File – Display a list of all opened files.
Ctrl + K, P (Cmd + K, P on macOS): Copy Path of Active File – Copy the path of the active file to the clipboard.
Ctrl + K, Ctrl + C (Cmd + K, Cmd + C on macOS): Add Line Comment – Comment out the current line or selected block of code.
Ctrl + K, Ctrl + U (Cmd + K, Cmd + U on macOS): Remove Line Comment – Uncomment the current line or selected block of code.
Ctrl + Shift + K (Cmd + Shift + K on macOS): Delete Line – Delete the current line.
Ctrl + Shift + [ (Cmd + Shift + [ on macOS): Fold (Collapse) Region – Fold the current code region.
These shortcuts can significantly improve your efficiency when working in Visual Studio Code by reducing the need to use the mouse and allowing you to perform common tasks more quickly.
[fluentform id="8"]