MeshWorld India LogoMeshWorld.
VS CodeIDEKeyboard ShortcutsDeveloper ToolsProductivityCheatsheetEditor9 min read

VS Code Shortcuts for Developers: The Complete Cheatsheet

Darsh Jariwala
By Darsh Jariwala
VS Code Shortcuts for Developers: The Complete Cheatsheet

VS Code has over 1,000 commands, but you only need about 30 to work efficiently. This guide covers the shortcuts that save real time — editing, navigation, debugging, Git, and terminal integration.

TL;DR
  • Command Palette: Ctrl+Shift+P / Cmd+Shift+P — Access everything
  • Quick Open: Ctrl+P / Cmd+P — Open files by name
  • Multi-cursor: Ctrl+D / Cmd+D — Edit multiple occurrences
  • Go to Definition: F12 — Jump to symbol definition
  • Integrated Terminal: Ctrl+` — Toggle without leaving editor
  • Command + Click: Go to definition with mouse

Essential Shortcuts

Command Palette & Navigation

ShortcutWindows/LinuxmacOSAction
Command PaletteCtrl+Shift+PCmd+Shift+PAccess all commands
Quick Open FileCtrl+PCmd+POpen file by name
Go to SymbolCtrl+Shift+OCmd+Shift+OJump to function/class
Go to LineCtrl+GCmd+GJump to line number
Go to DefinitionF12F12Jump to symbol
Go Back/ForwardAlt+←/→Ctrl+- / Cmd+Shift+-Navigate history
Show ExplorerCtrl+Shift+ECmd+Shift+EFocus file explorer
Show SearchCtrl+Shift+FCmd+Shift+FGlobal search
Show GitCtrl+Shift+GCtrl+Shift+GSource control panel
Show ExtensionsCtrl+Shift+XCmd+Shift+XExtensions marketplace

Editing

ShortcutWindows/LinuxmacOSAction
Multi-cursor SelectCtrl+DCmd+DSelect next occurrence
Select All OccurrencesCtrl+Shift+LCmd+Shift+LEdit all at once
Multi-cursor (click)Alt+ClickOption+ClickPlace cursor anywhere
Move Line Up/DownAlt+↑/↓Option+↑/↓Move line
Copy Line Up/DownShift+Alt+↑/↓Shift+Option+↑/↓Duplicate line
Delete LineCtrl+Shift+KCmd+Shift+KRemove current line
Insert Line BelowCtrl+EnterCmd+EnterNew line, stay put
Insert Line AboveCtrl+Shift+EnterCmd+Shift+EnterNew line above
Toggle CommentCtrl+/Cmd+/Comment/uncomment line
Format DocumentShift+Alt+FShift+Option+FAuto-format
Format SelectionCtrl+K Ctrl+FCmd+K Cmd+FFormat selected
Fold/UnfoldCtrl+Shift+[ / ]Cmd+Option+[ / ]Collapse code
Toggle Word WrapAlt+ZOption+ZWrap long lines

Code Navigation

ShortcutWindows/LinuxmacOSAction
Peek DefinitionAlt+F12Option+F12Inline definition
Find All ReferencesShift+F12Shift+F12List references
Rename SymbolF2F2Refactor rename
Show ProblemsCtrl+Shift+MCmd+Shift+MError list
Next Error/WarningF8F8Jump to next issue
Previous ErrorShift+F8Shift+F8Jump to previous
Trigger SuggestCtrl+SpaceCtrl+SpaceShow autocomplete
Trigger Parameter HintCtrl+Shift+SpaceCmd+Shift+SpaceFunction params
Show HoverCtrl+K Ctrl+ICmd+K Cmd+IShow info tooltip
Go to BracketCtrl+Shift+\Cmd+Shift+\Jump to matching bracket
ShortcutWindows/LinuxmacOSAction
FindCtrl+FCmd+FCurrent file search
ReplaceCtrl+HCmd+HFind and replace
Find in FilesCtrl+Shift+FCmd+Shift+FGlobal search
Replace in FilesCtrl+Shift+HCmd+Shift+HGlobal replace
Select LineCtrl+LCmd+LSelect entire line
Expand SelectionShift+Alt+→Ctrl+Shift+→Smart expand
Shrink SelectionShift+Alt+←Ctrl+Shift+←Smart shrink

Terminal Integration

ShortcutWindows/LinuxmacOSAction
Toggle TerminalCtrl+`Ctrl+`Show/hide terminal
New TerminalCtrl+Shift+Ctrl+Shift+Create new terminal
Focus Terminal`Ctrl+“`Ctrl+“Switch to terminal
Focus EditorCtrl+1Cmd+1Switch to editor
Run SelectedCtrl+Shift+EnterCmd+Shift+EnterRun in terminal
Kill TerminalCtrl+Shift+KCmd+Shift+KClose terminal

Debugging

ShortcutWindows/LinuxmacOSAction
Start DebuggingF5F5Run with debugger
Run Without DebugCtrl+F5Cmd+F5Run without attach
Stop DebuggingShift+F5Shift+F5Stop session
Toggle BreakpointF9F9Add/remove breakpoint
Step OverF10F10Next line
Step IntoF11F11Enter function
Step OutShift+F11Shift+F11Exit function
ContinueF5F5Resume execution
RestartCtrl+Shift+F5Cmd+Shift+F5Restart debugging
Show Debug ConsoleCtrl+Shift+YCmd+Shift+YDebug output

Git Integration

ShortcutWindows/LinuxmacOSAction
Open Source ControlCtrl+Shift+GCtrl+Shift+GGit panel
Stage SelectedCtrl+EnterCmd+EnterStage changes
Stage AllCtrl+Shift+EnterCmd+Shift+EnterStage everything
CommitCtrl+EnterCmd+EnterCommit staged
Commit AllCtrl+Shift+EnterCmd+Shift+EnterCommit all
PullN/AN/AUse command palette
PushN/AN/AUse command palette
Open ChangesCtrl+K Ctrl+DCmd+K Cmd+DShow diff
Show Git LogN/AN/AUse GitLens extension

Window & View Management

ShortcutWindows/LinuxmacOSAction
Toggle SidebarCtrl+BCmd+BShow/hide explorer
Toggle PanelCtrl+JCmd+JShow/hide bottom panel
Toggle TerminalCtrl+`Ctrl+`Show/hide terminal
Split EditorCtrl+\Cmd+\Create new editor group
Focus Next GroupCtrl+1/2/3Cmd+1/2/3Switch editor groups
Close EditorCtrl+WCmd+WClose current tab
Close AllCtrl+K Ctrl+WCmd+K Cmd+WClose all tabs
Reopen ClosedCtrl+Shift+TCmd+Shift+TRestore closed tab
Full ScreenF11Ctrl+Cmd+FToggle fullscreen
Zen ModeCtrl+K ZCmd+K ZDistraction-free

Pro Tips

Quick File Navigation

plaintext
Ctrl+P (or Cmd+P on Mac)
> Type filename (fuzzy match)
> Use @ to go to symbol: file@function
> Use : to go to line: file:42
> Use > to run command

Examples:

  • user → finds UserController.ts
  • user@create → opens UserController.ts at create function
  • user:25 → opens at line 25

Multi-Cursor Magic

plaintext
1. Alt+Click (Option+Click) → place cursors anywhere
2. Ctrl+D (Cmd+D) → select next occurrence
3. Ctrl+Shift+L (Cmd+Shift+L) → select all occurrences
4. Ctrl+Alt+↓ (Cmd+Option+↓) → add cursor to next line

Emmet Abbreviations

Built into VS Code for HTML/CSS:

plaintext
! → HTML5 boilerplate
div.container → <div class="container"></div>
ul>li*5 → 5 list items
header+main+footer → 3 sibling elements

Type abbreviation then press Tab.

Snippets

plaintext
Create custom snippets:
File → Preferences → User Snippets

Example (JavaScript):
"console.log": {
    "prefix": "clog",
    "body": "console.log('$1:', $1);",
    "description": "Log with label"
}

Type clog, press Tab, enter variable name.

Custom Keybindings

Add to keybindings.json

Ctrl+K Ctrl+S → Open Keyboard Shortcuts → Click icon to open JSON:

json
[
    {
        "key": "ctrl+shift+t",
        "command": "workbench.action.terminal.focus"
    },
    {
        "key": "ctrl+shift+a",
        "command": "workbench.action.quickOpen"
    },
    {
        "key": "f12",
        "command": "editor.action.revealDefinition",
        "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
    },
    {
        "key": "ctrl+shift+r",
        "command": "editor.action.rename",
        "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
    }
]

Conditional Keybindings

json
{
    "key": "ctrl+enter",
    "command": "acceptSelectedSuggestion",
    "when": "suggestWidgetVisible && textInputFocus"
}

Essential Extensions

ExtensionShortcutPurpose
GitLensEnhanced Git annotations
PrettierShift+Alt+FCode formatting
ESLintJavaScript linting
VimVim keybindings
PythonPython support
DockerContainer management
Thunder ClientAPI testing
Error LensInline error display

Settings for Speed

Add to settings.json:

json
{
    "editor.cursorBlinking": "smooth",
    "editor.cursorSmoothCaretAnimation": true,
    "editor.smoothScrolling": true,
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true,
    "editor.tabSize": 2,
    "editor.insertSpaces": true,
    "editor.detectIndentation": true,
    "editor.quickSuggestions": {
        "other": true,
        "comments": false,
        "strings": false
    },
    "editor.suggestSelection": "first",
    "editor.acceptSuggestionOnCommitCharacter": false,
    "terminal.integrated.cursorBlinking": true,
    "workbench.tree.indent": 20,
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 1000
}

Language-Specific Shortcuts

TypeScript/JavaScript

ShortcutAction
Ctrl+. / Cmd+.Quick fix (add import, fix error)
F2Rename symbol
Ctrl+Shift+RRefactor
Ctrl+Shift+.Insert import

Python

ShortcutAction
Shift+EnterRun selection in Python terminal
Ctrl+Shift+PPython: Run FileRun current file
F5Debug Python file

Markdown

ShortcutAction
Ctrl+Shift+VPreview
Ctrl+K VSide-by-side preview
Ctrl+BBold
Ctrl+IItalic

Summary

Master these 20 shortcuts first:

  1. Ctrl+P / Cmd+P — Open files
  2. Ctrl+Shift+P / Cmd+Shift+P — Command palette
  3. Ctrl+D / Cmd+D — Multi-cursor
  4. F12 — Go to definition
  5. Ctrl+G / Cmd+G — Go to line
  6. Ctrl+` — Toggle terminal
  7. Ctrl+/ / Cmd+/ — Toggle comment
  8. Alt+↑/↓ / Option+↑/↓ — Move line
  9. Ctrl+F / Cmd+F — Find
  10. Ctrl+H / Cmd+H — Replace
  11. Ctrl+Shift+F / Cmd+Shift+F — Find in files
  12. Shift+Alt+F / Shift+Option+F — Format
  13. Ctrl+Space — Trigger suggest
  14. F2 — Rename
  15. Ctrl+B / Cmd+B — Toggle sidebar
  16. Ctrl+W / Cmd+W — Close tab
  17. Ctrl+Shift+T / Cmd+Shift+T — Reopen closed
  18. Ctrl+Shift+O / Cmd+Shift+O — Go to symbol
  19. Ctrl+K Ctrl+S / Cmd+K Cmd+S — Keyboard shortcuts
  20. Ctrl+K Z / Cmd+K Z — Zen mode

Speed comes from muscle memory. Pick 5 shortcuts, use them exclusively for a day, then add more.


Share_This Twitter / X
Darsh Jariwala
Written By

Darsh Jariwala

Full-stack developer and Developer Experience (DX) advocate. Passionate about building efficient workflows, mastering IDEs, and sharing technical insights that help developers work smarter.

Enjoyed this article?

Support MeshWorld and help us create more technical content