Fold four lines with a counted motion
zf3j
Example
Normal 0 / 1Normal 1 / 1one
two
three
four
keepCursor on line 1, column 1one
two
three
four
keepCursor on line 1, column 1Combine the fold operator with a three-line downward motion.
Folds
Combine the fold operator with a three-line downward motion
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
Before & after
one
two
three
four
keepCursor on line 1, column 1Folds
one
two
three
four
keepCursor on line 1, column 1Folds
- 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.