Visual Studio Code (VS Code) is one of the most powerful code editors out there — not just because of what it can do, but how fast it lets you do it. Whether you’re a beginner or a seasoned developer, mastering shortcuts and hidden gems in VS Code can drastically boost your productivity.
🧠 1. Essential Keyboard Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Open Command Palette | Ctrl + Shift + P | Cmd + Shift + P |
Open File | Ctrl + P | Cmd + P |
Toggle Terminal | Ctrl + ~ | Ctrl + ~ |
Multi-Cursor | Alt + Click | Option + Click |
Format Document | Shift + Alt + F | Shift + Option + F |
Quick Fix | Ctrl + . | Cmd + . |
Move Line Up/Down | Alt + ↑ / ↓ | Option + ↑ / ↓ |
Duplicate Line | Shift + Alt + ↓ | Shift + Option + ↓ |
🛠️ 2. Command Palette Power
Use Ctrl/Cmd + Shift + P
to:
Toggle line numbers, word wrap, minimap
Access Git commands
Install extensions
Change themes, file icons, font size — all without touching settings.json
🚀 3. Go-to Shortcuts for Fast Navigation
Ctrl + Tab
: Switch between open filesCtrl + B
: Toggle sidebar (great for focus mode)Ctrl + Shift + O
: Jump to symbols in file (functions, variables)Ctrl + Shift + M
: Open problems panel (linting/errors)F12
: Go to DefinitionAlt + F12
: Peek Definition (opens inline)
🎯 4. Search Like a Pro
Ctrl + F
: Search within current fileCtrl + Shift + F
: Global search across your projectCtrl + H
: Find and replaceUse regex and case-sensitive toggles for advanced searches
💾 5. Auto-Save & Formatting on Save
Enable these in settings for peace of mind:
"files.autoSave": "onWindowChange",
"editor.formatOnSave": true
Set your default formatter (Prettier, ESLint, etc.) to avoid formatting inconsistencies.
🔍 6. Extensions That Supercharge Productivity
Prettier – Auto formats your code
ESLint – Linting and fixing issues automatically
Path Intellisense – Autocompletes file paths
GitLens – Git superpowers inside the editor
REST Client – Test APIs without Postman
Bracket Pair Colorizer 2 – Color-coded brackets for better readability
🖥️ 7. Customize Your Workspace
Create a .vscode/settings.json
in your project to define:
{
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
This ensures consistent formatting across your team.
🌈 8. Theme & Icon Tips
Use
Cmd/Ctrl + K + T
to switch themes.Recommended themes: Dracula, One Dark Pro, Ayu
Recommended file icons: Material Icon Theme
🪄 9. Snippets = Speed
Define your own snippets or install extension packs.
Example for a custom React snippet:
"React Component": {
"prefix": "rfc",
"body": [
"import React from 'react';",
"",
"const $1 = () => {",
" return <div>$1</div>;",
"};",
"",
"export default $1;"
]
}
🔚 Final Thoughts
VS Code is more than just a code editor — it's a productivity machine. Start small, learn a few shortcuts each week, and gradually customize your environment. Before you know it, you'll be flying through your code like a pro.
0 comments:
Post a Comment