Editor shortcuts (VS Code / Cursor and Vim)
Use when a user asks how to do something faster in VS Code (or Cursor) or Vim, asks what a keyboard shortcut does (e.g. Ctrl+D, Ctrl+Shift+P, F12, gg, dd, yy, ciw, :wq), wants to customise keybindings, or is stuck in Vim. Gives the correct shortcut for their operating system and can write keybindings.json entries.
Licence MIT
Source delaparra-original
Download zipEditor shortcuts (VS Code / Cursor and Vim)
Answer with the shortcut for the user's operating system. If you don't know the OS, give both Windows/Linux and macOS. Keep answers short: shortcut, what it does, when to use it.
VS Code / Cursor (defaults)
| Action | Windows / Linux | macOS |
|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick Open (go to file) | Ctrl+P | Cmd+P |
| Go to line | Ctrl+G | Ctrl+G |
| Go to definition | F12 | F12 |
| Rename symbol | F2 | F2 |
| Quick fix / show actions | Ctrl+. | Cmd+. |
| Select next occurrence | Ctrl+D | Cmd+D |
| Add cursor above / below | Ctrl+Alt+↑ / ↓ | Option+Cmd+↑ / ↓ |
| Add cursor at click | Alt+Click | Option+Click |
| Move line up / down | Alt+↑ / ↓ | Option+↑ / ↓ |
| Copy line up / down | Shift+Alt+↑ / ↓ | Shift+Option+↑ / ↓ |
| Delete line | Ctrl+Shift+K | Cmd+Shift+K |
| Delete previous word | Ctrl+Backspace | Option+Backspace |
| Move to line start / end | Home / End | Cmd+← / → |
| Toggle line comment | Ctrl+/ | Cmd+/ |
| Format document | Shift+Alt+F | Shift+Option+F |
| Search across files | Ctrl+Shift+F | Cmd+Shift+F |
| Autocomplete (trigger suggest) | Ctrl+Space | Ctrl+Space |
| Toggle sidebar | Ctrl+B | Cmd+B |
| Toggle integrated terminal | Ctrl+` | Ctrl+` |
| Save all | Ctrl+K S | Option+Cmd+S |
| Toggle breakpoint | F9 | F9 |
| Start / continue debugging | F5 | F5 |
| Step over / into / out | F10 / F11 / Shift+F11 | F10 / F11 / Shift+F11 |
| Open keyboard shortcuts | Ctrl+K Ctrl+S | Cmd+K Cmd+S |
Extract method/variable: select code, then Quick fix (Ctrl+. / Cmd+.) and pick "Extract…".
Custom keybinding example (keybindings.json, open via Command Palette → "Preferences: Open Keyboard Shortcuts (JSON)"):
[{ "key": "ctrl+alt+t", "command": "workbench.action.terminal.new" }]
Terminal
| Action | Keys |
|---|---|
| Cancel / interrupt running command (SIGINT) | Ctrl+C |
| Clear screen | Ctrl+L (or clear) |
| Reverse history search | Ctrl+R |
Vim (normal mode)
| Keys | Action |
|---|---|
Esc | Back to normal mode (do this first when stuck) |
:wq / :q! | Save and quit / quit without saving |
gg / G | Top / bottom of file |
dd | Delete (cut) line |
yy | Yank (copy) line |
p | Paste after cursor |
ciw | Change inner word |
u / Ctrl+R | Undo / redo |
/text then n | Search, next match |
Stuck in Vim after git commit or git rebase -i? Press Esc, type :wq, Enter. To use VS Code for Git messages instead: git config --global core.editor "code --wait".
Rules
- Shortcuts can be changed by the user or by keymap extensions; if a shortcut "doesn't work", suggest checking Keyboard Shortcuts for conflicts.
- Don't invent shortcuts. If unsure, point to the Command Palette, which shows the bound shortcut next to each command.
Files
LICENSESKILL.mdSOURCE.md
Related terms
- :wq (write & quit)
- /search
- Add Cursor Above / Below
- Add Cursor at Click
- Autocomplete
- Cancel / Interrupt (SIGINT)
- ciw (change inner word)
- Clear Screen
- Command Palette
- Copy Line Up / Down
- dd (delete line)
- Delete Line
- Delete Previous Word
- Extract Method / Variable
- Format Document
- gg / G (top / bottom)
- Go to Definition
- Go to Line
- Move Line Up / Down
- Move to Line Start / End
- Open Keyboard Shortcuts
- p (paste)
- Quick Fix / Show Actions
- Quick Open / Go to File
- Rename Symbol
- Reverse History Search
- Save All
- Search Across Files
- Select Next Occurrence
- Start / Continue Debugging
- Step Into
- Step Out
- Step Over
- Toggle Breakpoint
- Toggle Integrated Terminal
- Toggle Line Comment
- Toggle Sidebar
- yy (yank line)
Installing an agent skill in Claude Code, Codex, Cursor and Copilot