Vim Tips: Folding shortcut keys
Used in a very familiar, a period of time without, shortcut keys and forget, have to re-read the manual, today special finishing, and later find more convenient.
ZC folds, folds only the outermost folds
ZC collapses all nested collapsed points within the range, including any nested folds.
Zo expands to collapse, expanding only the outermost folds.
ZO expands on all nested collapsed points within the range, including nested folds.
[Z to the beginning of the currently open collapsed.
]z to the end of the currently open fold.
The ZJ moves down. arrives at the beginning of the next collapse. Closed folds are also counted.
ZK moves up to the end of the previous fold. The closed folds are also
ZD Remove (delete) is collapsed under the cursor. Valid only if ' Foldmethod ' is set to ' manual ' or ' marker '.
ZD Loop Delete (delete) is collapsed under the cursor, that is, nested delete collapses.
Valid only if ' Foldmethod ' is set to ' manual ' or ' marker '.
ZE Remove the "all" folding in the (Eliminate) window.
Valid only if ' Foldmethod ' is set to ' manual ' or ' marker '.
ZFAP move the cursor over a paragraph and press ZFAP to automatically add a fold label to the entire paragraph
Suppose you have created several folds, and now you need to read all the text. You can move to each of the folds and type "Zo". To do it faster, you can use this command: ZR
Zm
This will fold more (M-ore). You can repeat "ZR" and "ZM" to open and close several layers of nested folds, or one of them will be folded with ZC.
If you have a nested layer of deep folds, you can use this command to open them all:
ZR
This will reduce folding until one is left. And with this command you can close all the folds:
Zm
This will increase the folding until all the folds are closed.
You can use |zn|. command to quickly suppress the collapse feature. Then |zn| Restores the original folding. |zi| Switch to both
Between.
Vim Tips: Folding shortcut keys