Useful Vim Commands for Editing Prose

No plugins. Standard Vim only.

Optimized for plain text, notes, drafts, and long-form prose.


Navigation

Editing

Searching & Replacing

Paragraph & Formatting

Lines & Sorting

Marks & Jumps

Visual Mode

Other Essentials

Vim Prose Commands with Examples

Command Purpose Example / Notes
0 Beginning of line 0
^ First non-blank character ^
$ End of line $
w Next word w
e End of word e
b Previous word b
gg Top of file gg
G End of file G
dd Delete line dd
D Delete to end of line D
yy Yank (copy) line yy
p Paste after cursor p
P Paste before cursor P
J Join with next line J
>> / << Indent / un-indent line >>
u Undo u
Ctrl-r Redo Ctrl-r
. Repeat last change .
/pattern Search forward /hello
?pattern Search backward ?world
n / N Repeat search forward/back n
* / # Search word under cursor *
:%s/old/new/g Replace all occurrences :%s/foo/bar/g
:%s/old/new/gc Replace with confirmation :%s/foo/bar/gc
gq} Format paragraph gq}
gwip Reformat paragraph visually gwip
vip Select paragraph vip
:set textwidth=72 Set preferred line width :set textwidth=72
:set linebreak Wrap at word boundaries :set linebreak
ma Set mark at cursor ma
` a`` Jump to mark ` a``
'a Jump to mark line start 'a
'' Jump to previous mark ''
Ctrl-o / Ctrl-i Jump backward / forward Ctrl-o
v / V / Ctrl-v Visual char / line / block v
> / < Indent / un-indent selection >
~ Toggle case in selection ~
:set wrap / :set nowrap Toggle line wrapping :set wrap
:set number / :set nonumber Toggle line numbers :set number
:set spell Spell check :set spell
]s / [s Next / previous spelling error ]s
:set paste / :set nopaste Paste mode :set paste
:r filename Insert file at cursor :r notes.txt

Vim Prose Visual Cheat Sheet

Navigation Editing / Undo / Repeat
h j k l — move dd — delete line
0 / ^ / $ — line beg / first char / end D — delete to end of line
w / e / b — word fwd / end / back yy — yank line
gg / G — file top / end p / P — paste after / before
{ / } — paragraph prev / next J — join next line
Ctrl-d / Ctrl-u — half-page >> / << — indent / un-indent
H / M / L — screen top / mid / bottom u / Ctrl-r — undo / redo
. — repeat last edit :set paste / :set nopaste — paste mode
Search & Replace Paragraph / Formatting
/pattern / ?pattern — forward / backward gq} — format paragraph
n / N — repeat search gwip — reformat paragraph visually
* / # — word under cursor vip — select paragraph
:%s/old/new/g — replace all :set textwidth=72 — preferred line width
:%s/old/new/gc — confirm :set linebreak — wrap at word boundaries
Marks & Jumps Visual / Selection
ma — set mark v — char-wise select
` a`` — jump to mark V — line-wise select
'a — jump to mark line Ctrl-v — block / column select
'' — previous mark > / < — indent / un-indent selection
Ctrl-o / Ctrl-i — jump back / forward y / d — yank / delete selection
~ — toggle case in selection
Other Essentials Files / Display
:r filename — insert file :set wrap / :set nowrap — toggle wrap
:set number / :set nonumber — line numbers :set spell — spell check
]s / [s — next / prev spelling error :w !sudo tee % — write with sudo (OpenBSD Vim only)

✅ Notes for OpenBSD: