Visual Studio Code (VS Code) is arguably the most popular code editor in the world—and for good reason. It's lightweight, lightning-fast, and extremely customizable. But if you're only using your mouse and ignoring the power of keyboard shortcuts, you're not tapping into its full potential.
In this guide, you'll discover 40+ VS Code shortcuts—categorized for different tasks—that will dramatically improve your speed and workflow as a developer.
1. Basic Editing Shortcuts
Select Line
-
Windows/Linux:
Ctrl + L -
macOS:
Cmd + LSelects the entire line your cursor is on.
Duplicate Line
-
Windows/Linux:
Shift + Alt + ↓ / ↑ -
macOS:
Shift + Option + ↓ / ↑Duplicates the line above or below.
Move Line Up/Down
-
Windows/Linux:
Alt + ↑ / ↓ -
macOS:
Option + ↑ / ↓
Delete Line
-
Windows/Linux:
Ctrl + Shift + K -
macOS:
Cmd + Shift + K
2. Multi-Cursor and Selection Magic
Add Cursors Manually
-
Windows/Linux:
Alt + Click -
macOS:
Option + Click
Add Next Occurrence
-
Windows/Linux:
Ctrl + D -
macOS:
Cmd + D
Select All Occurrences
-
Windows/Linux:
Ctrl + Shift + L -
macOS:
Cmd + Shift + L
Undo Cursor
-
Windows/Linux:
Ctrl + U -
macOS:
Cmd + U
3. File Navigation Shortcuts
Quick Open File
-
Shortcut:
Ctrl + P/Cmd + PType the file name and jump instantly.
Open Recent Files
-
Windows/Linux:
Ctrl + R -
macOS:
Cmd + R
Open File in New Editor
-
Ctrl + Enter(afterCtrl + P)
4. Command Palette and Settings
Open Command Palette
-
Windows/Linux:
Ctrl + Shift + P -
macOS:
Cmd + Shift + P
Open Keyboard Shortcuts
Ctrl + K Ctrl + S
Open Settings
-
Ctrl + ,/Cmd + ,
5. Search and Replace
Global Search
-
Ctrl + Shift + F/Cmd + Shift + F
Replace in Files
-
Ctrl + Shift + H/Cmd + Shift + H
Search Within File
-
Ctrl + F/Cmd + F
Replace in Current File
-
Ctrl + H/Cmd + H
6. Code Navigation
Go to Definition
F12
Peek Definition
-
Alt + F12/Option + F12
Go to Implementation
-
Ctrl + F12/Cmd + F12
Go to Symbol
-
Ctrl + Shift + O/Cmd + Shift + O
Show All Symbols
-
Ctrl + T/Cmd + T
7. Editor Management
Toggle Sidebar
-
Ctrl + B/Cmd + B
Split Editor
-
Ctrl + \/Cmd + \
Focus into Editor Groups
Ctrl + 1 / 2 / 3
Switch Between Tabs
-
Ctrl + Tab/Cmd + Tab
Close Current Editor
-
Ctrl + W/Cmd + W
8. Terminal Shortcuts
Toggle Terminal
-
Ctrl + `/Cmd + `
Create New Terminal
-
Ctrl + Shift + '/Cmd + Shift + '
Clear Terminal
- Run
clearor useCtrl + K(in some shells)
9. Debugging Shortcuts
Start Debugging
F5
Stop Debugging
Shift + F5
Step Over
F10
Step Into
F11
Toggle Breakpoint
F9
10. Formatting and Refactoring
Format Document
-
Shift + Alt + F/Shift + Option + F
Rename Symbol
F2
Show Refactor Options
-
Ctrl + Shift + R/Cmd + Shift + R(context menu also works)
Auto Import Suggestions
- Start typing and use
TaborEnterto accept auto-imports
11. Extensions and Marketplace
Install Extensions Quickly
-
Ctrl + Shift + X/Cmd + Shift + X
Search Extensions
- Use the search bar and hit
EnterNavigate with arrow keys,Enterto install.
12. Snippets and Emmet
Trigger Suggestion
-
Ctrl + Space/Cmd + Space
Use Emmet in HTML/CSS
Type things like ul>li*5 and press Tab
Productivity Tip: Create Your Own Shortcuts
Go to:
File > Preferences > Keyboard Shortcuts
(Or press Ctrl + K Ctrl + S)
You can search and assign your own keybindings for any command.
Final Thoughts
Mastering VS Code shortcuts won’t just make you a faster developer—it’ll make your workflow smoother and your coding sessions far less frustrating. Start small, pick 5 shortcuts today, and use them until they become second nature. Then move on to 5 more.
You’ll thank yourself in the long run.
Want More?
If you enjoyed this guide and want more resources like:
- Developer ebooks
- Real-world coding projects
- Cheatsheets
- Productivity hacks
Check out my Gumroad store:
codewithdhanian.gumroad.com
Support my work and grab useful resources that will skyrocket your dev journey!
Top comments (2)
This was helpful
Thanks for sharing ✨
Fantastic App!feature-rich and intuitive.