← Home

Keyboard Shortcuts Cheatsheet

Essential keyboard shortcuts for developers — system, VS Code, Chrome DevTools, terminal, Git, and browser navigation on both Mac and Windows.

System / General

ActionMacWindows / Linux
CopyCmd + CCtrl + C
PasteCmd + VCtrl + V
CutCmd + XCtrl + X
UndoCmd + ZCtrl + Z
RedoCmd + Shift + ZCtrl + Y
Select allCmd + ACtrl + A
FindCmd + FCtrl + F
Find and replaceCmd + HCtrl + H
SaveCmd + SCtrl + S
Close window / tabCmd + WCtrl + W
Quit applicationCmd + QAlt + F4
Switch appsCmd + TabAlt + Tab
Screenshot (full)Cmd + Shift + 3Win + PrtSc
Screenshot (area)Cmd + Shift + 4Win + Shift + S
Lock screenCmd + Ctrl + QWin + L
Spotlight / SearchCmd + SpaceWin + S

VS Code

ActionMacWindows / Linux
Command PaletteCmd + Shift + PCtrl + Shift + P
Quick Open fileCmd + PCtrl + P
Toggle terminalCtrl + `Ctrl + `
Toggle sidebarCmd + BCtrl + B
Go to definitionF12F12
Peek definitionOpt + F12Alt + F12
Find in filesCmd + Shift + FCtrl + Shift + F
Move line up / downOpt + ↑ / ↓Alt + ↑ / ↓
Copy line up / downOpt + Shift + ↑ / ↓Alt + Shift + ↑ / ↓
Delete lineCmd + Shift + KCtrl + Shift + K
Multi-cursorOpt + ClickAlt + Click
Select all occurrencesCmd + Shift + LCtrl + Shift + L
Comment / uncomment lineCmd + /Ctrl + /
Format documentOpt + Shift + FAlt + Shift + F
Rename symbolF2F2
Split editorCmd + \Ctrl + \
Fold / unfold regionCmd + Opt + [ / ]Ctrl + Shift + [ / ]

Chrome DevTools

ActionMacWindows / Linux
Open DevToolsCmd + Opt + IF12 / Ctrl + Shift + I
Open ConsoleCmd + Opt + JCtrl + Shift + J
Inspect elementCmd + Shift + CCtrl + Shift + C
Toggle device modeCmd + Shift + MCtrl + Shift + M
Clear consoleCmd + KCtrl + L
Search across filesCmd + Opt + FCtrl + Shift + F
Run commandCmd + Shift + PCtrl + Shift + P
Next / prev panelCmd + ] / [Ctrl + ] / [
Hard refresh (no cache)Cmd + Shift + RCtrl + Shift + R

Terminal / Shell

ActionMacWindows / Linux
Clear terminalCmd + K / Ctrl + Lcls / Ctrl + L
Cancel commandCtrl + CCtrl + C
End of input (EOF)Ctrl + DCtrl + D
Move cursor to startCtrl + AHome
Move cursor to endCtrl + EEnd
Delete word backwardCtrl + WCtrl + Backspace
Previous command↑ / Ctrl + P
Search command historyCtrl + RCtrl + R
New tabCmd + TCtrl + Shift + T
Suspend processCtrl + ZCtrl + Z

Git (Command Line)

ActionMacWindows / Linux
Stage all changesgit add -Agit add -A
Commit with messagegit commit -m "msg"git commit -m "msg"
Push to remotegit pushgit push
Pull latestgit pullgit pull
Check statusgit statusgit status
View log (compact)git log --onelinegit log --oneline
Create & switch branchgit checkout -b namegit checkout -b name
Stash changesgit stashgit stash
Apply stashgit stash popgit stash pop
Diff staged changesgit diff --stagedgit diff --staged

Browser Navigation

ActionMacWindows / Linux
New tabCmd + TCtrl + T
Close tabCmd + WCtrl + W
Reopen closed tabCmd + Shift + TCtrl + Shift + T
Next tabCmd + Opt + →Ctrl + Tab
Previous tabCmd + Opt + ←Ctrl + Shift + Tab
Go to tab 1-8Cmd + 1-8Ctrl + 1-8
Address barCmd + LCtrl + L
Refresh pageCmd + RF5 / Ctrl + R
Back / ForwardCmd + ← / →Alt + ← / →
Bookmark pageCmd + DCtrl + D

FAQ

What is the Mac equivalent of Ctrl on Windows?

The Cmd (Command / ⌘) key on Mac corresponds to Ctrl on Windows for most shortcuts. The Mac Ctrl key is a separate key used primarily for terminal emulator shortcuts and right-click context menus.

How can I learn keyboard shortcuts faster?

Start with 3-5 shortcuts you'd use daily (e.g., Cmd+P for Quick Open, Cmd+Shift+P for Command Palette, Cmd+/ for comment). Practice them deliberately for a week before adding more. Most editors also have shortcut reference sheets you can print.

Can I customize VS Code keyboard shortcuts?

Yes. Open Keyboard Shortcuts with Cmd+K Cmd+S (Mac) or Ctrl+K Ctrl+S (Windows). You can search for any command and rebind it to your preferred key combination. VS Code also supports importing keymaps from other editors like Vim, Emacs, and Sublime Text.

Related Resources