The z Family

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

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

z contains three historical clusters: scroll positioning (zz, zt, zb), folding (zo, zc, zf, zR), and spelling (z=, zg, zw).

The z prefix does not have one meaning. Three separate clusters share the namespace: scrolling, folding, and spelling. Learn the pattern inside each cluster, but do not expect a new z command to be predictable from the prefix alone.

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 ยท
[missing screenshot prefix.z/frame_01.color.svg โ€” run python content/render_screenshots.py]
Step 2 ยท zt ยท zt โ€” current line to top.
[missing screenshot prefix.z/frame_02.color.svg โ€” run python content/render_screenshots.py]
Step 3 ยท zz ยท zz โ€” current line to center.
[missing screenshot prefix.z/frame_03.color.svg โ€” run python content/render_screenshots.py]
Step 4 ยท zb ยท zb โ€” current line to bottom.
[missing screenshot prefix.z/frame_04.color.svg โ€” run python content/render_screenshots.py]

Watch

See also: The g Family, Centering the Cursor, Folding