Vim Recall繁體中文

Fold four lines with a counted motion

zf3j

Example

Normal 0 / 1
one
two
three
four
keep
Cursor on line 1, column 1

Combine the fold operator with a three-line downward motion.

Folds

Empty
Before & after
Before
one
two
three
four
keep
Cursor on line 1, column 1

Folds

Empty
After
one
two
three
four
keep
Cursor on line 1, column 1

Folds

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

Start in Normal mode, at line 1, column 1 (one-based). Set foldmethod=manual. Including the current line produces a four-line fold. Press zf3j. Buffer contents stay unchanged; the fold changes the view.

Details & Vim help

Example replayed in Vim

Combine the fold operator with a three-line downward motion.

Set foldmethod=manual. Including the current line produces a four-line fold.