Cheatsheet Pages / Vim Cheatsheet

How to open a file in Vim at a line number or a match — vim +42, vim +/pattern

You know exactly where you need to land — a line number from an error message, or the first TODO in the file.

Almost every entry was run headless in Vim 9.1 and the resulting file checked; the few entries a tiny build cannot run (system clipboard, persistent undo, the sudo save) were verified against Vim's own documentation instead.

vim +42 notes.txt          # open with the cursor on line 42
vim +/TODO notes.txt       # open on the first line matching TODO
vim + notes.txt            # open on the last line
Vim Cheatsheet one-page card — commands that actually work
The full one-page card — Vim Cheatsheet. Get the complete cheatsheet on GitHub