⏳
Loading cheatsheet...
VS Code, IntelliJ, Terminal, Chrome DevTools, macOS, Windows, Git — master your keyboard.
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + P | Quick Open file |
| Cmd/Ctrl + Shift + P | Command Palette |
| Cmd/Ctrl + Shift + N | New window |
| Cmd/Ctrl + ` | Toggle terminal |
| Cmd/Ctrl + B | Toggle sidebar |
| Cmd/Ctrl + J | Toggle panel |
| Cmd/Ctrl + \ | Split editor |
| Cmd/Ctrl + 1/2/3 | Switch editor group |
| Cmd/Ctrl + W | Close tab |
| Cmd/Ctrl + K Cmd/Ctrl + W | Close all editors |
| Cmd/Ctrl + Tab | Switch between open files |
| Ctrl + G | Go to line |
| Cmd/Ctrl + Shift + O | Go to symbol in file |
| Cmd/Ctrl + T | Go to symbol in workspace |
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + X | Cut line (no selection) |
| Cmd/Ctrl + C | Copy line (no selection) |
| Cmd/Ctrl + V | Paste |
| Alt + Up/Down | Move line up/down |
| Shift + Alt + Up/Down | Duplicate line up/down |
| Cmd/Ctrl + Shift + K | Delete entire line |
| Cmd/Ctrl + / | Toggle line comment |
| Shift + Alt + A | Toggle block comment |
| Cmd/Ctrl + D | Add selection to next find match |
| Cmd/Ctrl + Shift + L | Select all occurrences |
| Cmd/Ctrl + U | Undo cursor position |
| Cmd/Ctrl + Shift + U | Redo cursor position |
| Home / End | Go to start/end of line |
| Cmd/Ctrl + Left/Right | Navigate word left/right |
| Shortcut | Action |
|---|---|
| Alt + Click | Insert cursor at click |
| Cmd/Ctrl + Alt + Up/Down | Insert cursor above/below |
| Cmd/Ctrl + D | Select next occurrence |
| Cmd/Ctrl + Shift + D | Skip current, select next |
| Cmd/Ctrl + Shift + L | Select all occurrences |
| Cmd/Ctrl + Shift + Alt + (arrow) | Column selection |
| Shift + Alt + Drag | Column selection (mouse) |
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + F | Find |
| Cmd/Ctrl + H | Find and Replace |
| Cmd/Ctrl + Shift + F | Find in files |
| Cmd/Ctrl + Shift + H | Replace in files |
| Alt + Enter | Select all find matches |
| F3 / Shift + F3 | Find next/previous |
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + ` | Toggle terminal |
| Cmd/Ctrl + Shift + ` | Create new terminal |
| Cmd/Ctrl + C | Copy (terminal focus) |
| Cmd/Ctrl + V | Paste (terminal focus) |
| Cmd/Ctrl + Shift + Up/Down | Scroll terminal |
| Cmd/Ctrl + Shift + ] | Focus next terminal group |
| Shortcut | Action |
|---|---|
| F5 | Start/Continue debugging |
| F9 | Toggle breakpoint |
| F10 | Step over |
| F11 | Step into |
| Shift + F11 | Step out |
| Shift + F5 | Stop debugging |
| Cmd/Ctrl + Shift + D | Debug view |
| Cmd/Ctrl + Shift + I | Toggle maximized panel |
// Custom keybindings (Cmd/Ctrl + Shift + P → "Open Keyboard Shortcuts JSON")
[
{
"key": "cmd+shift+t",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+;",
"command": "editor.action.commentLine",
"when": "editorTextFocus"
},
{
"key": "alt+shift+f",
"command": "editor.action.formatDocument"
}
]Cmd/Ctrl + K, Cmd/Ctrl + S to open the Keyboard Shortcuts editor where you can search, modify, and export all keybindings. Use when clauses to make context-sensitive bindings.| Shortcut (Mac/Win) | Action |
|---|---|
| Cmd/Ctrl + Shift + A | Find Action (anything) |
| Cmd/Ctrl + O | Go to class/file |
| Cmd/Ctrl + Shift + O | Go to symbol |
| Cmd/Ctrl + E | Recent files |
| Cmd/Ctrl + Shift + E | Recent edited files |
| Cmd/Ctrl + B | Go to declaration |
| Cmd/Ctrl + Alt + B | Go to implementation |
| Cmd/Ctrl + Shift + B | Go to type declaration |
| Cmd/Ctrl + [ / ] | Navigate back / forward |
| Cmd/Ctrl + L | Go to line |
| F2 / Shift + F2 | Next/previous highlighted error |
| Cmd/Ctrl + F12 | File structure popup |
| Alt + Up/Down | Navigate methods in class |
| Shortcut (Mac/Win) | Action |
|---|---|
| Shift + F6 | Rename |
| Cmd/Ctrl + Option/Alt + V | Extract variable |
| Cmd/Ctrl + Option/Alt + C | Extract constant |
| Cmd/Ctrl + Option/Alt + F | Extract field |
| Cmd/Ctrl + Option/Alt + M | Extract method |
| Cmd/Ctrl + Option/Alt + P | Extract parameter |
| Cmd/Ctrl + Shift + T | Create test |
| Cmd/Ctrl + D | Duplicate line |
| Cmd/Ctrl + Delete | Delete line |
| Cmd/Ctrl + Alt + L | Reformat code |
| Cmd/Ctrl + Alt + O | Optimize imports |
| Cmd/Ctrl + Alt + I | Auto-indent lines |
| F5 | Copy (no selection = line) |
| F6 | Move (no selection = line) |
| Shortcut (Mac/Win) | Action |
|---|---|
| Cmd/Ctrl + F | Find in file |
| Cmd/Ctrl + R | Replace in file |
| Cmd/Ctrl + Shift + F | Find in project |
| Cmd/Ctrl + Shift + R | Replace in project |
| Cmd/Ctrl + Shift + I | Find usages |
| Alt + F7 | Find usages (list) |
| Cmd/Ctrl + Alt + F7 | Find usages (file view) |
| Cmd/Ctrl + F7 | Find usages in file |
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + N | Generate code (getter, etc.) |
| sout + Tab | System.out.println() |
| psvm + Tab | public static void main() |
| fori + Tab | for loop with index |
| iter + Tab | for-each loop |
| ifn + Tab | if null check |
| inn + Tab | if not null check |
| thr + Tab | throw new |
| sur + Tab | wrap with try-catch |
| Shortcut | Action |
|---|---|
| Ctrl + A | Move cursor to start of line |
| Ctrl + E | Move cursor to end of line |
| Ctrl + B | Move cursor back one character |
| Ctrl + F | Move cursor forward one character |
| Ctrl + U | Cut from cursor to start of line |
| Ctrl + K | Cut from cursor to end of line |
| Ctrl + W | Cut word before cursor |
| Ctrl + Y | Paste (yank) last cut text |
| Ctrl + L | Clear screen |
| Ctrl + C | Cancel/kill running process |
| Ctrl + D | EOF / exit shell |
| Ctrl + Z | Suspend process (bg with fg) |
| Ctrl + R | Reverse search history |
| Ctrl + S | Forward search (may need stty) |
| Ctrl + T | Swap last two characters |
| Ctrl + P | Previous command in history |
| Ctrl + N | Next command in history |
| Ctrl + M | Same as Enter |
| Ctrl + H | Same as Backspace |
| Shortcut | Action |
|---|---|
| Alt + B | Move cursor back one word |
| Alt + F | Move cursor forward one word |
| Alt + Backspace | Delete word before cursor |
| Alt + D | Delete word after cursor |
| Alt + . | Insert last argument of prev cmd |
| Alt + _ | Same as Alt + . (alternate) |
| Alt + C | Capitalize word under cursor |
| Alt + L | Lowercase word from cursor |
| Alt + U | Uppercase word from cursor |
| Alt + T | Swap last two words |
| Alt + N | Insert last arg (next in hist) |
| Alt + Y | Rotate yank through kill ring |
| Alt + R | Undo all changes to line |
| Shortcut | Action |
|---|---|
| Ctrl+b, c | Create new window |
| Ctrl+b, n | Next window |
| Ctrl+b, p | Previous window |
| Ctrl+b, w | List windows |
| Ctrl+b, % | Split pane vertically |
| Ctrl+b, " | Split pane horizontally |
| Ctrl+b, arrow keys | Switch panes |
| Ctrl+b, x | Close current pane |
| Ctrl+b, d | Detach session |
| Ctrl+b, [ | Enter scroll/copy mode |
| Ctrl+b, ] | Paste from buffer |
| Ctrl+b, z | Zoom pane toggle |
| Ctrl+b, s | List sessions |
| Shortcut | Action |
|---|---|
| Ctrl+a, c | Create new window |
| Ctrl+a, n | Next window |
| Ctrl+a, p | Previous window |
| Ctrl+a, 0-9 | Switch to window number |
| Ctrl+a, d | Detach session |
| Ctrl+a, k | Kill current window |
| Ctrl+a, S | Split region horizontally |
| Ctrl+a, | | Split region vertically |
| Ctrl+a, Tab | Switch between regions |
| Ctrl+a, [ | Enter copy/scroll mode |
| Ctrl+a, ] | Paste |
| Ctrl+a, A | Rename window |
# Enhanced readline configuration
set -o vi # Use vi mode for readline
set -o emacs # Use emacs mode (default)
# Disable Ctrl+S freeze
stty -ixon
# Useful history settings
export HISTSIZE=10000
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# Aliases for common shortcuts
alias ll='ls -alF'
alias gs='git status'
alias gp='git push'
alias dc='docker compose'| Shortcut | Action |
|---|---|
| F12 | Open DevTools |
| Cmd/Ctrl + Shift + I | Open DevTools |
| Cmd/Ctrl + Shift + J | Open Console directly |
| Cmd/Ctrl + Shift + C | Inspect element (picker) |
| Cmd/Ctrl + Shift + M | Toggle device toolbar |
| Cmd/Ctrl + ] | Next panel |
| Cmd/Ctrl + [ | Previous panel |
| Cmd/Ctrl + 1-9 | Switch panel (1=Elements, 2=Console) |
| Esc | Toggle drawer |
| Shortcut | Action |
|---|---|
| Enter | Execute expression |
| Shift + Enter | New line (no execute) |
| Up/Down arrows | Navigate command history |
| $_ | Last evaluated expression |
| $0-$4 | Last 5 inspected DOM elements |
| Cmd/Ctrl + L | Clear console |
| Cmd/Ctrl + K | Clear console (Mac) |
| Shift + Cmd/Ctrl + E | Preserve log on nav |
| Click filter levels | Verbose/Info/Warn/Error |
| Cmd/Ctrl + F | Search in console |
| Shortcut | Action |
|---|---|
| H | Toggle element visibility |
| Del / Backspace | Delete selected element |
| Cmd/Ctrl + Z | Undo deletion |
| Cmd/Ctrl + F | Search within DOM tree |
| Cmd/Ctrl + Shift + C | Select element by click |
| Cmd/Ctrl + Shift + M | Toggle responsive mode |
| Tab | Next attribute |
| Enter | Edit attribute |
| Right click node | Context menu actions |
| Drag node | Reorder DOM elements |
| Ctrl + / | Toggle comment on node |
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + R | Record / reload |
| Cmd/Ctrl + Shift + R | Hard reload (clear cache) |
| Cmd/Ctrl + E | Export HAR |
| Cmd/Ctrl + F | Search network requests |
| Cmd/Ctrl + Shift + F | Search all sources |
| Cmd/Ctrl + O | Open file in Sources |
| Cmd/Ctrl + Shift + O | Open workspace |
| Cmd/Ctrl + G | Go to line in source |
| Cmd/Ctrl + / | Toggle comment |
| F8 | Pause/resume script |
| F10 | Step over |
| F11 | Step into |
| Shift + F11 | Step out |
| Shift + Cmd/Ctrl + F | Search in all files |
$0 in the Console. You can run $0.click() or $0.style.color = 'red' to interact with it programmatically.| Shortcut | Action |
|---|---|
| Cmd + Space | Spotlight search |
| Cmd + Option + Esc | Force Quit dialog |
| Cmd + Option + D | Show/Hide Dock |
| Cmd + Control + Q | Lock screen |
| Cmd + Shift + Q | Log out |
| Cmd + Option + Power | Sleep |
| Cmd + Control + Power | Restart (confirm) |
| Cmd + Option + Control + Power | Quit all apps |
| Cmd + Shift + 3 | Screenshot (full screen) |
| Cmd + Shift + 4 | Screenshot (selection) |
| Cmd + Shift + 4 + Space | Screenshot (window) |
| Cmd + Shift + 5 | Screenshot toolbar |
| Shortcut | Action |
|---|---|
| Cmd + Tab | Switch applications |
| Cmd + Shift + Tab | Switch apps (reverse) |
| Cmd + ` | Switch windows in same app |
| Cmd + H | Hide active application |
| Cmd + Option + H | Hide other apps |
| Cmd + M | Minimize window |
| Ctrl + Up Arrow | Mission Control |
| Ctrl + Down Arrow | App Exposé |
| Ctrl + Left/Right | Switch full-screen spaces |
| Cmd + Option + F | Go to Spotlight results |
| F3 | Mission Control (or Ctrl+Up) |
| F4 | Launchpad |
| Shortcut | Action |
|---|---|
| Cmd + Shift + N | New Finder window |
| Cmd + N | New Finder tab |
| Cmd + W | Close Finder window/tab |
| Cmd + Shift + . | Show hidden files |
| Cmd + Shift + G | Go to folder |
| Cmd + Delete | Move to Trash |
| Cmd + Shift + Delete | Empty Trash |
| Space (quick look) | Preview selected file |
| Cmd + I | Get Info |
| Cmd + Shift + I | Show Inspector |
| Cmd + [ / ] | Go back / forward |
| Cmd + Up Arrow | Enclosing folder |
| Cmd + Down Arrow | Open selected item |
| Cmd + A | Select all |
| Shortcut | Action |
|---|---|
| Cmd + C / V / X | Copy / Paste / Cut |
| Cmd + Z | Undo |
| Cmd + Shift + Z | Redo |
| Cmd + A | Select all |
| Cmd + F | Find |
| Cmd + G | Find next |
| Cmd + Option + F | Replace |
| Cmd + Left/Right | Beginning/end of line |
| Option + Left/Right | Move by word |
| Cmd + Shift + Left/Right | Select to line edge |
| Option + Delete | Delete word backward |
| Fn + Delete | Forward delete |
| Shortcut | Action |
|---|---|
| Win | Open Start Menu |
| Win + E | File Explorer |
| Win + D | Show/hide desktop |
| Win + L | Lock screen |
| Win + R | Run dialog |
| Win + S | Search (Cortana) |
| Win + I | Settings |
| Win + K | Connect (cast/devices) |
| Win + A | Action Center (quick settings) |
| Win + N | Notifications panel |
| Win + X | Power user menu |
| Win + P | Project (display options) |
| Win + U | Accessibility settings |
| Win + , | Temporarily peek at desktop |
| Win + Pause | System properties |
| Win + V | Clipboard history (Win 10+) |
| Shortcut | Action |
|---|---|
| Win + Tab | Task View (virtual desktops) |
| Win + Ctrl + D | Create new virtual desktop |
| Win + Ctrl + Left/Right | Switch desktops |
| Win + Ctrl + F4 | Close current desktop |
| Win + Left/Right | Snap window left/right |
| Win + Up | Maximize window |
| Win + Down | Minimize / restore down |
| Win + Shift + Left/Right | Move to other monitor |
| Alt + Tab | Switch between apps |
| Alt + F4 | Close active window |
| Ctrl + Shift + Esc | Task Manager directly |
| Ctrl + Alt + Del | Security screen (lock/Task Mgr) |
| Win + Shift + S | Snipping tool / screenshot |
| Win + G | Xbox Game Bar |
| Shortcut | Action |
|---|---|
| Alt + D | Focus address bar |
| Ctrl + N | New window |
| Ctrl + W | Close window |
| Ctrl + Shift + N | New folder |
| F2 | Rename selected item |
| F11 | Toggle full screen |
| Alt + Up | Go up one level |
| Alt + Left/Right | Back / Forward |
| Alt + Enter | Properties |
| Ctrl + A | Select all |
| Ctrl + Click (check) | Select individual files |
| Shift + Click | Select range |
| Shortcut | Action |
|---|---|
| Win + Shift + Enter | Run as admin (in search) |
| Ctrl + Shift + C/V | Copy/Paste in CMD (new) |
| Tab | Auto-complete path |
| Up/Down arrows | Command history |
| F7 | Command history list |
| Alt + F7 | Clear command history |
| Ctrl + C | Cancel current command |
| Ctrl + L / Ctrl + K | Clear screen (PowerShell) |
| Alt + Enter | Toggle full screen (CMD) |
| Win + . | Emoji picker (Win 10 1803+) |
# Essential git aliases (add to ~/.gitconfig)
[alias]
s = status
co = checkout
br = branch
ci = commit
st = stash
lg = log --oneline --graph --decorate -20
amend = commit --amend --no-edit
unstage = reset HEAD --
last = log -1 HEAD
uncommit = reset --soft HEAD~1
# View diff of last commit
diff-last = diff HEAD~1 HEAD
# List all branches sorted by last commit
bl = branch -v --sort=-committerdate
# Delete merged branches
dm = "!git branch --merged | grep -v '\*\|main\|master' | xargs -n1 git branch -d"| Hook | Use Case |
|---|---|
| pre-commit | Run linters, format code |
| commit-msg | Validate commit message format |
| pre-push | Run tests before pushing |
| post-merge | Install updated dependencies |
| prepare-commit-msg | Add issue number to msg |
| Technique | Description |
|---|---|
| git stash pop | Apply & remove last stash |
| git commit -am "msg" | Stage all tracked & commit |
| git add -p | Stage changes interactively |
| git checkout - | Switch to last branch |
| git log --oneline -10 | Compact log (last 10) |
| git diff --staged | View staged changes |
| git reset --soft HEAD~1 | Undo commit, keep changes |
| git clean -fd | Remove untracked files/dirs |
| git reflog | View all HEAD movements |
# Bash functions for git speed
# Quick branch switch with fzf (if installed)
gco() { git branch | fzf | xargs git checkout; }
# Show files changed in last commit
glc() { git diff --name-only HEAD~1 HEAD; }
# Undo last commit but keep changes staged
guncommit() { git reset --soft HEAD~1; }
# Create PR from current branch (GitHub CLI)
gpr() {
BRANCH=$(git branch --show-current)
gh pr create --title "$BRANCH" --fill
}