Create a fold for the text covered by the motion
zf{motion}
Example
Normal 0 / 1Normal 1 / 1outer start
first
second
third
outer end
separator
last lineCursor on line 1, column 1outer start
first
second
third
outer end
separator
last lineCursor on line 1, column 1Create a fold for the text covered by the motion.
Folds
Option · foldenable
- Local foldenable
1- Global foldenable
1
Option · foldlevel
- Local foldlevel
0- Global foldlevel
0
Create a fold for the text covered by the motion
Folds
- Line 1 · level 1 Active
closed · lines 1–2- Line 2 · level 1
closed · lines 1–2
Option · foldenable
- Local foldenable
1- Global foldenable
1
Option · foldlevel
- Local foldlevel
0- Global foldlevel
0
Before & after
outer start
first
second
third
outer end
separator
last lineCursor on line 1, column 1Folds
Option · foldenable
- Local foldenable
1- Global foldenable
1
Option · foldlevel
- Local foldlevel
0- Global foldlevel
0
outer start
first
second
third
outer end
separator
last lineCursor on line 1, column 1Folds
- Line 1 · level 1 Active
closed · lines 1–2- Line 2 · level 1
closed · lines 1–2
Option · foldenable
- Local foldenable
1- Global foldenable
1
Option · foldlevel
- Local foldlevel
0- Global foldlevel
0
Start in Normal mode. The motion is literal and the resulting fold ranges are read back from Vim.
Details & Vim help
Example replayed in Vim
Create a fold for the text covered by the motion. Use in Normal mode. Braced names stand for the required argument and are not typed literally. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative. Creating folds this way requires 'foldmethod' to be manual or marker.