IDE & Terminal Keyboard Shortcuts Reference

38 shortcuts every developer leans on — in VS Code, JetBrains IDEs, Vim, and the terminal. Each one in plain English, with the Mac and Windows/Linux keys side by side.

Last reviewed:

Power shortcuts every developer should know

You don't need to memorise hundreds of bindings. A handful pays for itself within a day: Command Palette (when you forget anything), Quick Open (jump to any file), Go to Definition (read unfamiliar code), Rename Symbol (refactor safely), Select Next Occurrence (edit many spots at once), and Reverse History Search (stop retyping commands). Learn those six first; the rest stick naturally.

macOS vs Windows/Linux: the single biggest difference is the modifier. Where macOS uses ⌘ Cmd, Windows and Linux almost always use Ctrl. So ⌘ P becomes Ctrl + P. The ⌥ Option key on Mac maps to Alt elsewhere, and ⌃ Control on Mac is mostly reserved for terminal and Vim-style bindings (which are the same on every platform).

Sections

Editing

Toggle Line Comment

VS Code / JetBrains

Comment or uncomment the current line (or selection). Works in any language.

Mac⌘ / Win/LinuxCtrl + /

Move Line Up / Down

VS Code / JetBrains

Move the current line (or selected block) up or down without cut-and-paste.

Mac⌥ ↑ / ⌥ ↓ Win/LinuxAlt + ↑ / Alt + ↓

Copy Line Up / Down

VS Code

Duplicate the current line above or below the original.

Mac⌥ ⇧ ↑ / ⌥ ⇧ ↓ Win/LinuxAlt + Shift + ↑ / ↓

Delete Line

VS Code

Remove the entire current line in one keystroke.

Mac⌘ ⇧ K Win/LinuxCtrl + Shift + K

Format Document

VS Code

Re-indent and tidy the whole file using the configured formatter (Prettier, gofmt, etc.).

Mac⌥ ⇧ F Win/LinuxAlt + Shift + F

Save All

VS Code

Write every modified file to disk at once.

Mac⌘ ⌥ S Win/LinuxCtrl + K S

dd (delete line)

Vim

Vim: delete the current line. Press twice — d then d.

Macd d Win/Linuxd d

💡 The deleted line goes into the register, so you can paste it back with p.

yy (yank line)

Vim

Vim: copy ("yank") the current line into the register.

Macy y Win/Linuxy y

p (paste)

Vim

Vim: paste whatever is in the register after the cursor.

Macp Win/Linuxp

💡 Uppercase P pastes before the cursor instead.

ciw (change inner word)

Vim

Vim: delete the word under the cursor and drop straight into insert mode to retype it.

Macc i w Win/Linuxc i w

:wq (write & quit)

Vim

Vim: save the file and close the editor. The legendary "how do I exit Vim" answer.

Mac: w q Win/Linux: w q

💡 :q! quits without saving; ZZ is a shorthand for write-and-quit.

Multi-cursor selection

Select Next Occurrence

VS Code

Add the next match of the current word to your selection so you can edit several at once.

Mac⌘ D Win/LinuxCtrl + D

💡 Press repeatedly to grab more matches. ⌘⇧L / Ctrl+Shift+L selects every occurrence at once.

Add Cursor Above / Below

VS Code

Stack extra cursors on the lines above or below to type the same thing on many lines.

Mac⌥ ⌘ ↑ / ↓ Win/LinuxCtrl + Alt + ↑ / ↓

Add Cursor at Click

VS Code

Drop an additional cursor anywhere you click while holding the modifier.

Mac⌥ Click Win/LinuxAlt + Click

Refactoring

Rename Symbol

VS Code / JetBrains

Rename a variable, function, or class everywhere it is used — safely, across the project.

MacF2 Win/LinuxF2

💡 This is rename-aware, not find-and-replace — it understands scope and won't touch unrelated strings.

Quick Fix / Show Actions

VS Code

Open the lightbulb menu of suggested fixes and refactorings for the code under the cursor.

Mac⌘ . Win/LinuxCtrl + .

Extract Method / Variable

JetBrains

Pull selected code out into its own method or variable. A JetBrains staple of clean refactoring.

Mac⌃ T Win/LinuxCtrl + Alt + M

💡 In JetBrains, ⌃T (Mac) opens the Refactor This menu; Ctrl+Alt+M extracts a method directly on Win/Linux.

Search Across Files

VS Code

Search the whole project for a string or pattern, with replace-in-files support.

Mac⌘ ⇧ F Win/LinuxCtrl + Shift + F

Debugging

Start / Continue Debugging

VS Code / JetBrains

Launch the debugger, or resume execution until the next breakpoint.

MacF5 Win/LinuxF5

Toggle Breakpoint

VS Code / JetBrains

Set or clear a breakpoint on the current line so execution pauses there.

MacF9 Win/LinuxF9

Step Over

VS Code

Run the current line and stop on the next one, without descending into function calls.

MacF10 Win/LinuxF10

Step Into

VS Code

Descend into the function call on the current line to debug it line by line.

MacF11 Win/LinuxF11

Step Out

VS Code

Finish the current function and return to the caller.

Mac⇧ F11 Win/LinuxShift + F11

Terminal & shell

Toggle Integrated Terminal

VS Code

Show or hide the terminal panel inside the editor.

Mac⌃ ` Win/LinuxCtrl + `

Cancel / Interrupt (SIGINT)

Terminal

Stop the running command — send an interrupt signal to whatever is in the foreground.

Mac⌃ C Win/LinuxCtrl + C

Reverse History Search

Terminal

Search backwards through your command history as you type. Saves retyping long commands.

Mac⌃ R Win/LinuxCtrl + R

💡 Press ⌃R again to cycle to older matches.

Move to Line Start / End

Terminal

Jump the cursor to the beginning (Ctrl+A) or end (Ctrl+E) of the command line.

Mac⌃ A / ⌃ E Win/LinuxCtrl + A / Ctrl + E

Clear Screen

Terminal

Wipe the terminal screen, keeping the current command line intact.

Mac⌃ L Win/LinuxCtrl + L

💡 Equivalent to typing clear, but instant and non-destructive to your typed line.

Autocomplete

Terminal

Complete a file name, command, or path. Press twice to list all matches.

Mac⇥ Tab Win/LinuxTab

Delete Previous Word

Terminal

Delete the word to the left of the cursor on the command line.

Mac⌃ W Win/LinuxCtrl + W

English phrases engineers use

  • "Just hit Cmd+P and type the file name — don't dig through the tree."
  • "Drop a breakpoint on line 42 and step through it."
  • "Select all occurrences with Cmd+Shift+L and rename them in one go."
  • "If you forget the shortcut, open the command palette and search for it."
  • "Ctrl+R back through your history — you ran that exact command yesterday."
  • "How do I get out of Vim? Press Escape, then type :wq."
  • "Ctrl+C out of it — the process is hung."