VIM Cheatsheet: Interactive Command Guide

Hey there! Welcome to the ultimate VIM cheatsheet. Dive into this interactive guide to get a visual breakdown of VIM commands for all modes. Whether you're just starting out or you're a VIM pro, this cheatsheet is your ticket to mastering VIM and supercharging your text editing skills.

VIM Mode Selection

Current VIM Mode: Normal

Explore VIM commands by hovering over keys. Click on a key or press it on your keyboard for detailed command information. Hold Shift or Ctrl to see modified key combinations.

Interactive VIM Keyboard Layout

Common VIM Commands for Normal Mode

  • 0: Move to start of line
  • Esc: Return to Normal mode
  • !: Filter lines through an external command
  • @: Play a macro
  • #: Search for the word under the cursor, backwards
  • $: Move to end of line
  • %: Move to matching item (bracket, parenthesis, etc.)
  • ^: Move to first non-blank character of line
  • &: Repeat the last :s substitute command
  • *: Search for the word under the cursor, forwards
  • (: Move to the beginning of the current sentence
  • ): Move to the beginning of the next sentence
  • -: Move to the beginning of the previous line
  • _: Move to the first non-blank character of the previous line
  • +: Move to the beginning of the next line
  • [: Move to previous { in block
  • ]: Move to next } in block
  • {: Move to the beginning of the current paragraph or block
  • }: Move to the beginning of the next paragraph or block
  • |: Move to column n in the current line
  • ;: Repeat the last f, F, t, or T movement
  • :: Enter Command-Line mode
  • ': Move to the start of the line of the mark
  • ": Begin a register name
  • `: Move to the exact position of the mark
  • ,: Repeat the last f, F, t, or T movement in opposite direction
  • <: Shift left
  • >: Shift right
  • /: Search forward
  • ?: Search backward
  • .: Repeat last command
  • ~: Toggle case of character under cursor
  • a: Enter Insert mode after cursor
  • A: Enter Insert mode at the end of the line
  • b: Move backward to start of previous word
  • B: Move backward to start of previous WORD
  • c: Change selection and enter Insert mode
  • C: Change to end of line and enter Insert mode
  • d: Delete selection
  • D: Delete to end of line
  • e: Move to end of word
  • E: Move to end of WORD
  • f: Move to next occurrence of character
  • F: Move to previous occurrence of character
  • g: Perform various commands (e.g., gg, g$, etc.)
  • G: Go to last line of document
  • h: Move cursor left
  • H: Move to top of screen
  • i: Enter Insert mode before cursor
  • I: Enter Insert mode at the beginning of the line
  • j: Move cursor down
  • J: Join line below to the current one
  • k: Move cursor up
  • K: Display documentation for keyword under cursor
  • l: Move cursor right
  • L: Move to bottom of screen
  • m: Set mark
  • M: Move to middle of screen
  • n: Repeat search forward
  • N: Repeat search backward
  • o: Open new line below and enter Insert mode
  • O: Open new line above and enter Insert mode
  • p: Paste after cursor
  • P: Paste before cursor
  • q: Record a macro
  • Q: Enter Ex mode
  • r: Replace character
  • R: Enter Replace mode
  • s: Substitute character and enter Insert mode
  • S: Substitute line and enter Insert mode
  • t: Move to before next occurrence of character
  • T: Move to before previous occurrence of character
  • u: Undo
  • U: Restore line
  • v: Enter Visual mode
  • V: Enter Visual Line mode
  • w: Move forward to start of next word
  • W: Move forward to start of next WORD
  • x: Delete character under cursor
  • X: Delete character before cursor
  • y: Yank (copy) selection
  • Y: Yank (copy) whole line
  • z: Various commands (e.g., zz to center line, zt, zb, etc.)
  • Z: Various commands (e.g., ZZ to save and quit, ZQ to quit without saving)
  • Ctrl-a: Increment number under cursor
  • Ctrl-b: Scroll back
  • Ctrl-c: Interrupt current operation
  • Ctrl-d: Scroll down
  • Ctrl-e: Scroll window downwards
  • Ctrl-f: Scroll forward
  • Ctrl-g: Display file name and cursor position
  • Ctrl-i: Go to newer cursor position
  • Ctrl-l: Redraw screen
  • Ctrl-o: Go to older cursor position
  • Ctrl-r: Redo
  • Ctrl-u: Scroll up
  • Ctrl-w: Window commands
  • Ctrl-x: Decrement number under cursor
  • Ctrl-y: Scroll window upwards
  • Ctrl-z: Suspend Vim
  • Ctrl-[: Return to Normal mode
  • Ctrl-\: Enter Insert Normal mode
  • Ctrl-]: Jump to tag under cursor
  • Ctrl-^: Switch to alternate file