Vim Cheat Sheet

Essential commands, navigation, editing, and an interactive practice mode.

Interactive Practice Mode
NORMAL
Hello, Vim! Welcome to the interactive practice mode. Use h, j, k, l to navigate. Press i to enter Insert mode. Press Esc to return to Normal mode. Press x to delete characters. Press v to enter Visual mode.
"practice.txt" 7L, 192B 1,1

Why Learn Vim?

Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X. Learning Vim commands can significantly speed up your workflow by keeping your hands on the keyboard and reducing reliance on the mouse.

The Core Modes of Vim

Vim is a "modal" editor, meaning the same keys perform different actions depending on the current mode:

  • Normal Mode: The default mode. Used for navigation, deletion, copying, pasting, and issuing commands. You can always return to this mode by pressing Esc.
  • Insert Mode: Used for typing text. Entered by pressing i, a, o, etc. In this mode, Vim behaves like a standard text editor.
  • Visual Mode: Used for selecting text blocks to apply commands to them (like copy or delete). Entered by pressing v (character-wise), V (line-wise), or Ctrl+v (block-wise).
  • Command-Line Mode: Used to enter complex commands at the bottom of the screen. Entered by typing : (colon), / (search), or ? (search backwards).

Navigating the Vim Way

While you can often use arrow keys, true Vim proficiency comes from using the home row keys for movement. The core navigation keys are h (left), j (down), k (up), and l (right). Combining these movement keys with counts (e.g., 5j to move down 5 lines) or with actions (e.g., d5j to delete 5 lines downwards) forms the powerful "grammar" of Vim.