Here’s a breakdown of common commands in Visual Studio Code (VS Code), categorized for better understanding:
General Commands
- Command Palette (
Ctrl+Shift+P
orF1
)
Access all available commands in VS Code. - Quick Open (
Ctrl+P
)
Open files by typing their name. - Settings (
Ctrl+,
)
Open the settings editor. - Toggle Sidebar (
Ctrl+B
)
Show or hide the sidebar. - Zen Mode (
Ctrl+K Z
)
Enter distraction-free fullscreen mode.
File Management
- New File (
Ctrl+N
)
Create a new file. - Open File (
Ctrl+O
)
Open an existing file. - Save File (
Ctrl+S
)
Save the current file. - Save All (
Ctrl+K S
)
Save all open files. - Close File (
Ctrl+W
)
Close the current file. - Reopen Closed File (
Ctrl+Shift+T
)
Reopen a previously closed file.
Navigation
- Go to Line/Column (
Ctrl+G
)
Jump to a specific line or column in a file. - Go to Symbol (
Ctrl+Shift+O
)
Navigate to a symbol in the file. - Go to Definition (
F12
)
Jump to the definition of a symbol. - Peek Definition (
Alt+F12
)
View a symbol’s definition inline. - Switch Editor Group (
Ctrl+1/2/3
)
Focus on a specific editor group.
Editing
- Multi-Cursor (
Alt+Click
orCtrl+Alt+Arrow Up/Down
)
Add multiple cursors for simultaneous editing. - Duplicate Line (
Shift+Alt+Down
)
Duplicate the current line. - Move Line (
Alt+Arrow Up/Down
)
Move the current line up or down. - Auto-Format (
Shift+Alt+F
)
Format code in the active file. - Comment Line (
Ctrl+/
)
Toggle a single-line comment.
Search
- Find (
Ctrl+F
)
Search for text in the current file. - Find and Replace (
Ctrl+H
)
Search and replace text in the current file. - Search in Files (
Ctrl+Shift+F
)
Search across all files in the workspace.
Version Control
- Open Source Control (
Ctrl+Shift+G
)
Open the Git source control panel. - Commit (
Ctrl+Enter
)
Commit changes in the source control view. - View File History (
Right-Click → File History
)
See version history of a file.
Debugging
- Start Debugging (
F5
)
Begin a debug session. - Step Over (
F10
)
Move to the next statement without entering functions. - Step Into (
F11
)
Move into a function. - Toggle Breakpoint (
F9
)
Set or remove a breakpoint on a line.
Terminal
- Open Terminal (
Ctrl+
)
Open the integrated terminal. - Switch Terminal (
Ctrl+
)
Switch between terminal instances. - Kill Terminal (
Ctrl+Shift+W
)
Close the active terminal.
Extensions
- Extensions View (
Ctrl+Shift+X
)
Browse and manage extensions. - Install Extensions (
Search in Extensions View
)
Find and install VS Code extensions. - Disable/Enable Extensions (
Right-Click Extension
)
Toggle extensions as needed.
These are just a few of the essential commands. The Command Palette (Ctrl+Shift+P
) is your best friend to explore more!
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.