Boost Your Productivity with These Essential VS Code Shortcuts
Visual Studio Code (VS Code) is one of the most powerful and widely-used code editors available today. It’s lightweight, highly customizable, and packed with features that can significantly boost your development workflow. But to truly unlock its potential, mastering keyboard shortcuts is key.
In this article, I’ll walk you through some of the most useful VS Code shortcuts that can save you time, reduce context switching, and make your coding experience smoother.
🚀 General Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Command Palette | Ctrl + Shift + P |
Cmd + Shift + P |
Open File | Ctrl + P |
Cmd + P |
New File | Ctrl + N |
Cmd + N |
Save File | Ctrl + S |
Cmd + S |
Close Editor | Ctrl + W |
Cmd + W |
Split Editor | Ctrl + \ |
Cmd + \ |
Toggle Terminal | Ctrl + ' |
Cmd + ' |
These are your everyday productivity boosters. The Command Palette is especially powerful—it gives you access to nearly every feature in VS Code without leaving your keyboard.
🧭 Navigation Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Go to Line | Ctrl + G |
Cmd + G |
Go to File | Ctrl + P |
Cmd + P |
Go to Symbol | Ctrl + Shift + O |
Cmd + Shift + O |
Go to Definition | F12 |
F12 |
Peek Definition | Alt + F12 |
Option + F12 |
Go Back | Alt + ← |
Ctrl + - |
These shortcuts help you quickly navigate large codebases without using the mouse. If you work in large projects, Go to Symbol and Peek Definition are absolute lifesavers.
✂️ Editing Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Copy Line Down | Shift + Alt + ↓ |
Shift + Option + ↓ |
Move Line Up/Down | Alt + ↑ / ↓ |
Option + ↑ / ↓ |
Delete Line | Ctrl + Shift + K |
Cmd + Shift + K |
Select Line | Ctrl + L |
Cmd + L |
Duplicate Selection | Shift + Alt + ↑ |
Shift + Option + ↑ |
Comment Line | Ctrl + / |
Cmd + / |
These are great for speeding up editing and refactoring. Once you get used to moving lines around or duplicating them without reaching for the mouse, you won’t want to go back.
🔎 Search and Replace
Action | Windows/Linux | macOS |
---|---|---|
Find | Ctrl + F |
Cmd + F |
Replace | Ctrl + H |
Cmd + H |
Find in Files | Ctrl + Shift + F |
Cmd + Shift + F |
Replace in Files | Ctrl + Shift + H |
Cmd + Shift + H |
Whether you're fixing a typo across a file or refactoring variable names project-wide, these shortcuts will save you from repetitive manual work.
🛠️ Debugging Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Start/Continue Debugging | F5 |
F5 |
Step Into | F11 |
F11 |
Step Over | F10 |
F10 |
Step Out | Shift + F11 |
Shift + F11 |
Toggle Breakpoint | F9 |
F9 |
Open Debug Panel | Ctrl + Shift + D |
Cmd + Shift + D |
If you're using VS Code's debugger, these shortcuts can make debugging faster and more efficient, helping you identify and solve issues in real time.
🧠 Multi-Cursor & Selection
Action | Windows/Linux | macOS |
---|---|---|
Add Cursor Below | Ctrl + Alt + ↓ |
Cmd + Option + ↓ |
Add Cursor Above | Ctrl + Alt + ↑ |
Cmd + Option + ↑ |
Select All Occurrences | Ctrl + Shift + L |
Cmd + Shift + L |
Select Next Occurrence | Ctrl + D |
Cmd + D |
Multi-cursor editing is a game-changer. Use it to rename multiple variables, change repeated lines, or update HTML tags all at once.
🧩 Bonus Tips
-
Zen Mode: Hide all distractions by pressing
Ctrl + K Z
(orCmd + K Z
on Mac). -
Toggle Sidebar:
Ctrl + B
(Cmd + B
on Mac). -
IntelliSense Trigger:
Ctrl + Space
(Cmd + Space
on Mac).
Final Thoughts
Mastering these VS Code shortcuts will transform how you code. It’s not about memorizing them all at once—start with the ones that solve your daily pain points, and build from there.
The more you integrate them into your workflow, the more second nature they'll become. And the more time you’ll save for what really matters—writing great code.
🧠 Got a favorite shortcut not listed here? Share it in the comments or tag me on social media!
Top comments (0)