30 Must‑Know VS Code Shortcuts to Supercharge Your Coding
This guide lists thirty essential Visual Studio Code keyboard shortcuts—covering search, navigation, editing, debugging, and more—for Windows, macOS, and Linux, explaining each key combination, its purpose, and how it can dramatically speed up development workflows.
Visual Studio Code (VS Code) is a widely used, cross‑platform code editor. Mastering its keyboard shortcuts lets developers perform common tasks faster, reduce mouse reliance, and keep focus on writing code.
01. Search across all files
Press Ctrl + Shift + F (Windows/Linux) or Command + Shift + F (macOS) to open the global search panel, type any text, and locate matches in every file of the workspace.
02. Reopen a closed editor tab
Press Ctrl + Shift + T (Windows/Linux/macOS) to restore the most recently closed tab.
03. Add selection to next match
Press Ctrl + D (Windows/Linux/macOS) to select the next occurrence of the current word or selection.
04. Delete previous word
Press Ctrl + Backspace (Windows/Linux) or Option + Backspace (macOS) to delete the word to the left of the cursor.
05. Delete a line
Press Ctrl + X to cut the entire line.
Press Ctrl + Shift + K to delete the line without copying it.
06. Select a word
Press Ctrl + Shift + ←/→ to expand the selection by word boundaries.
07. Jump to file start or end
Press Ctrl + Home to go to the top of the file.
Press Ctrl + End to go to the bottom.
08. Move a line up or down
Press Alt + ↑/↓ (Windows/Linux) or Option + ↑/↓ (macOS) to shift the current line or selection.
09. Add cursors above/below
Press Ctrl + Alt + ↑/↓ to create additional cursors on adjacent lines.
Press Ctrl + Shift + ←/→ to add a cursor to the left or right.
10. Duplicate line above or below
Press Shift + Alt + ↑/↓ to copy the current line up or down.
11. Fold or unfold code
Press Ctrl + Shift + [ to fold the selected region.
Press Ctrl + Shift + ] to unfold.
12. Go to a specific line
Press Ctrl + G , then type the line number and press Enter.
13. Column (box) selection
Press Shift + Alt + drag (or Shift + Alt + ↑/↓ ) to select a rectangular block of text.
14. Join lines
Open File > Preferences > Keyboard Shortcuts , search for action.joinLines, and bind it (e.g., Ctrl + J on Windows, Control + J on macOS).
15. Format document
Press Shift + Alt + F (Windows/Linux) or Shift + Option + F (macOS) to auto‑format the file.
16. Trim trailing whitespace
Enable "trimTrailingWhitespace": true in settings.json (accessed via File > Preferences > Settings ) to automatically remove spaces at line ends on save.
17. Split editor
Press Shift + Alt + \ (Windows/Linux) or Command + \ (macOS) to create a side‑by‑side editor pane.
18. Go to symbol in file
Press Ctrl + Shift + O (Windows/Linux) or Command + Shift + O (macOS) to list symbols defined in the current file.
19. Go to symbol in workspace
Press Ctrl + T (Windows/Linux) or Command + T (macOS) to search symbols across the entire workspace.
20. Rename symbol
Press F2 (any platform) with the cursor on a symbol to rename it project‑wide.
21. Toggle sidebar
Press Ctrl + B (Windows/Linux) or Command + B (macOS) to show or hide the Explorer sidebar.
22. Open command palette
Press Ctrl + P (Windows/Linux) or Command + P (macOS) to open the palette, then type commands or file names.
23. Open file by matching text
Open Keyboard Shortcuts, search for action.quickOpen , and assign a convenient key binding to open files by typing matching text.
24. Open integrated terminal
Press Ctrl + ` (all platforms) to toggle the built‑in terminal.
25. Replace all matches in current file
Press Ctrl + F2 to select all occurrences of the current word, then edit them simultaneously.
26. Switch tabs
Press Ctrl + 1/2/3 to focus the first, second, or third editor tab.
27. Navigate editor history
Press Alt + ←/→ to move backward or forward through the file navigation history.
28. Focus debugger
Press F5 to start debugging, Shift + F5 to stop, and F9 to toggle breakpoints.
29. Trigger IntelliSense and comment selection
Press Ctrl + Space to invoke code completion.
Press Ctrl + K + C to comment the selected block.
Press Ctrl + K + U to uncomment.
30. Go to definition and references
Press F12 to jump to a symbol’s definition.
Press Shift + F12 to view all references.
By incorporating these shortcuts into daily workflows, developers can navigate, edit, and debug code more efficiently, saving time and keeping their focus on problem solving rather than repetitive UI interactions.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
