Vim Recall繁體中文

Fold an entire paragraph

zfap

Example

Normal 0 / 1
one
two

keep
Cursor on line 1, column 1

Create a manual fold using a text object.

Folds

Empty
Before & after
Before
one
two

keep
Cursor on line 1, column 1

Folds

Empty
After
one
two

keep
Cursor on line 1, column 1

Folds

Line 1 · level 1 Active
closed · lines 1–3
Line 2 · level 1
closed · lines 1–3
Line 3 · level 1
closed · lines 1–3

Start in Normal mode, at line 1, column 1 (one-based). Set foldmethod=manual. The paragraph and adjacent blank line become the fold range. Press zfap. Buffer contents stay unchanged; the fold changes the view.

Details & Vim help

Example replayed in Vim

Create a manual fold using a text object.

Set foldmethod=manual. The paragraph and adjacent blank line become the fold range.