Vim keyboard shortcuts cheat sheet

Printable cheat sheet covering all 270 Vim 9 keyboard shortcuts and hotkeys, organized by category. Export as PDF or print directly.

All shortcuts

  • H — Move cursor left
  • J — Move cursor down
  • K — Move cursor up
  • L — Move cursor right
  • W — Move to start of next word
  • Shift+W — Move to start of next WORD (whitespace-delimited)
  • B — Move to start of previous word
  • Shift+B — Move to start of previous WORD (whitespace-delimited)
  • E — Move to end of word
  • Shift+E — Move to end of WORD (whitespace-delimited)
  • 0 — Move to start of line
  • Shift+6 — Move to first non-blank character of line (^)
  • Shift+4 — Move to end of line ($)
  • G — Go to first line of file
  • Shift+G — Go to last line of file
  • Ctrl+F — Page down (full screen)
  • Ctrl+B — Page up (full screen)
  • Ctrl+D — Scroll half page down
  • Ctrl+U — Scroll half page up
  • F — Find character forward on line
  • Shift+F — Find character backward on line
  • T — Move to before character forward on line
  • Shift+T — Move to after character backward on line
  • Semicolon — Repeat last f/F/t/T forward
  • Comma — Repeat last f/F/t/T backward
  • Shift+5 — Jump to matching bracket (%)
  • Shift+H — Move to top of screen
  • Shift+M — Move to middle of screen
  • Shift+L — Move to bottom of screen
  • Shift+BracketRight — Move to next paragraph (})
  • Shift+BracketLeft — Move to previous paragraph ({)
  • Shift+9 — Move to start of previous sentence
  • Shift+0 — Move to start of next sentence
  • ArrowLeft — Move cursor left
  • ArrowDown — Move cursor down
  • ArrowUp — Move cursor up
  • ArrowRight — Move cursor right
  • Ctrl+Y — Scroll screen up one line
  • Ctrl+E — Scroll screen down one line
  • Shift+Backslash — Go to column (|)
  • Shift+Equal — Move to first non-blank of next line (+)
  • Minus — Move to first non-blank of previous line
  • D — Delete (operator, awaits motion)
  • C — Change (operator, awaits motion)
  • Y — Yank/copy (operator, awaits motion)
  • P — Paste after cursor
  • Shift+P — Paste before cursor
  • X — Delete character under cursor
  • Shift+X — Delete character before cursor
  • R — Replace character under cursor
  • Shift+R — Enter Replace mode
  • Shift+Backquote — Toggle case of character (~)
  • Shift+Period — Indent line right (>>)
  • Shift+Comma — Indent line left (<<)
  • Equal — Auto-indent line (==)
  • S — Substitute character (delete and enter insert mode)
  • Shift+S — Substitute entire line (change whole line)
  • Shift+C — Change from cursor to end of line
  • Shift+D — Delete from cursor to end of line
  • Shift+Y — Yank from cursor to end of line
  • I — Insert before cursor
  • Shift+I — Insert at beginning of line
  • A — Append after cursor
  • Shift+A — Append at end of line
  • O — Open new line below and enter insert mode
  • Shift+O — Open new line above and enter insert mode
  • D — Delete entire line
  • Y — Yank (copy) entire line
  • C — Change entire line
  • Shift+J — Join current line with next line
  • U — Undo last change
  • Ctrl+R — Redo last undone change
  • Period — Repeat last change
  • Shift+U — Undo all changes on current line
  • Ctrl+K — Insert digraph (special character)
  • Ctrl+A — Increment number under cursor
  • Ctrl+X — Decrement number under cursor
  • G — Join lines without inserting space
  • Slash — Search forward
  • Shift+Slash — Search backward (?)
  • N — Repeat search in same direction
  • Shift+N — Repeat search in opposite direction
  • Shift+8 — Search word under cursor forward (*)
  • Shift+3 — Search word under cursor backward (#)
  • G — Search partial word under cursor forward (g*)
  • G — Search partial word under cursor backward (g#)
  • Shift+Semicolon — Clear search highlighting (:nohl)
  • Shift+Semicolon — Save file (:w)
  • Shift+Semicolon — Quit (:q)
  • Shift+Semicolon — Save and quit (:wq)
  • Shift+Semicolon — Force quit without saving (:q!)
  • Shift+Z — Save and quit (ZZ)
  • Shift+Z — Quit without saving (ZQ)
  • Shift+Semicolon — Save all open buffers (:wa)
  • Shift+Semicolon — Open file for editing (:e)
  • Shift+Semicolon — Go to next buffer (:bn)
  • Shift+Semicolon — Go to previous buffer (:bp)
  • Shift+Semicolon — Delete/close current buffer (:bd)
  • Shift+Semicolon — List all buffers (:ls)
  • Shift+Semicolon — Save all and quit (:wqa)
  • Ctrl+G — Show file info (name, lines, position)
  • Ctrl+W — Split window horizontally
  • Ctrl+W — Split window vertically
  • Ctrl+W — Cycle between windows
  • Ctrl+W — Move to window on the left
  • Ctrl+W — Move to window below
  • Ctrl+W — Move to window above
  • Ctrl+W — Move to window on the right
  • Ctrl+W — Close current window
  • Ctrl+W — Close all windows except current
  • Ctrl+W — Increase window height
  • Ctrl+W — Decrease window height
  • Ctrl+W — Equalize window sizes
  • Ctrl+W — Maximize window height (_)
  • Ctrl+W — Maximize window width (|)
  • Ctrl+W — Rotate windows downward
  • Ctrl+W — Rotate windows upward
  • Ctrl+W — Exchange current window with next
  • Shift+Semicolon — Open new tab (:tabnew)
  • G — Go to next tab
  • G — Go to previous tab
  • M — Set mark (followed by mark letter)
  • Quote — Jump to mark line (followed by mark letter)
  • Backquote — Jump to mark exact position (followed by mark letter)
  • Ctrl+O — Jump to previous position in jump list
  • Ctrl+I — Jump to next position in jump list
  • Quote — Jump to last edit position
  • Quote — Jump to position before last jump
  • Quote — Jump to last insert position
  • Quote — Jump to start of last change
  • Quote — Jump to end of last change
  • G — Jump to next position in change list
  • G — Jump to previous position in change list
  • Shift+Semicolon — Enter command-line mode (:)
  • Escape — Return to Normal mode
  • Ctrl+BracketLeft — Return to Normal mode (Ctrl+[)
  • Q — Record macro (followed by register letter)
  • Shift+2 — Play macro (@ followed by register letter)
  • Shift+2 — Repeat last played macro (@@)
  • Z — Center screen on cursor
  • Z — Scroll cursor line to top of screen
  • Z — Scroll cursor line to bottom of screen
  • Shift+Semicolon — Open file explorer (:Ex)
  • Ctrl+BracketRight — Jump to tag/definition under cursor
  • Ctrl+T — Return from tag jump
  • G — Go to file under cursor
  • G — Go to local declaration
  • G — Show ASCII value of character under cursor
  • Ctrl+L — Redraw screen
  • Ctrl+Z — Suspend Vim (return to shell)
  • V — Enter Visual mode (character-wise)
  • Shift+V — Enter Visual Line mode
  • Ctrl+V — Enter Visual Block mode
  • G — Reselect last visual selection
  • D — Delete selection
  • Y — Yank (copy) selection
  • C — Change selection (delete and enter insert mode)
  • Shift+Period — Indent selection right (>)
  • Shift+Comma — Indent selection left (<)
  • Equal — Auto-indent selection
  • Shift+Backquote — Toggle case of selection (~)
  • Shift+U — Make selection uppercase
  • U — Make selection lowercase
  • Shift+J — Join selected lines
  • O — Swap cursor to other end of selection
  • H — Extend selection left
  • J — Extend selection down
  • K — Extend selection up
  • L — Extend selection right
  • W — Extend selection to next word
  • B — Extend selection to previous word
  • Shift+4 — Extend selection to end of line ($)
  • 0 — Extend selection to start of line
  • G — Extend selection to start of file
  • Shift+G — Extend selection to end of file
  • P — Paste over selection
  • R — Replace every character in selection
  • Shift+Semicolon — Sort selected lines (:sort)
  • Escape — Exit Insert mode to Normal mode
  • Ctrl+BracketLeft — Exit Insert mode to Normal mode (Ctrl+[)
  • Ctrl+C — Exit Insert mode (without triggering abbreviations)
  • Ctrl+W — Delete word before cursor
  • Ctrl+U — Delete to start of line
  • Ctrl+H — Delete character before cursor (backspace)
  • Ctrl+T — Indent current line
  • Ctrl+D — Un-indent current line
  • Ctrl+R — Insert contents of register
  • Ctrl+N — Autocomplete next match
  • Ctrl+P — Autocomplete previous match
  • Ctrl+O — Execute one Normal mode command then return to Insert
  • Ctrl+Enter — Insert newline above current line
  • Tab — Insert tab or trigger completion
  • Backspace — Delete character before cursor
  • Ctrl+V — Insert next character literally
  • Ctrl+X — Enter Ctrl-X sub-mode for special completions
  • Escape — Cancel command and return to Normal mode
  • Enter — Execute command
  • ArrowUp — Previous command in history
  • ArrowDown — Next command in history
  • Tab — Tab completion for commands and paths

Other Code & Text apps

  • Alacritty shortcuts
  • Android Studio shortcuts
  • Arduino IDE shortcuts
  • Bitbucket shortcuts
  • Chrome Developer Tools shortcuts
  • CLion shortcuts
  • Code Editor for iOS shortcuts
  • Cursor shortcuts
  • DataGrip shortcuts
  • Docker Desktop shortcuts

Related pages

  • Vim shortcuts
  • Vim cheat sheet
  • Learn Vim shortcuts
  • All Code & Text apps