The z Family

Folding, scrolling, spell. The most thematically scattered prefix.

Keys: zz, zt, zb, zo, zc, zf, zR, zM, z=, zg

z handles three loosely-related families: scroll positioning (zz, zt, zb), folding (zo, zc, zf, zR), and spell suggestions (z=, zg, zw).

The z Family

The z prefix is even more scattered than g. Three separate families share the prefix because Vim ran out of one-key real estate: scrolling, folding, and spell-checking.

Reference (most-used)

Key Family Action
zz Scroll Cursor's line โ†’ middle
zt Scroll Cursor's line โ†’ top
zb Scroll Cursor's line โ†’ bottom
z. Scroll Like zz, cursor โ†’ first non-blank
zs / ze Scroll Horizontal: cursor โ†’ left / right
zo Fold Open one fold
zc Fold Close one fold
zO / zC Fold Open / close folds recursively
za Fold Toggle one fold
zR Fold Open all folds
zM Fold Close all folds
zr / zm Fold Open / close one level
zf{motion} Fold Create fold over motion
zd / zE Fold Delete this fold / all folds
z= Spell Suggest corrections
zg / zw Spell Mark word as good / wrong
zn / zN Fold Disable / re-enable folding

Worked example โ€” zz zt zb

Viewport positioning with z.

Step 1 ยท
prefix.z
Step 2 ยท zt ยท zt โ€” current line to top.
zt โ€” current line to top.

โ–ถ Try this in the simulator

Watch

See also: The {key:g} Family, Centering the Cursor, Folding