Original article address:
Http://hqlong.com/2010/01/1254.html
Vim tips: Collapse shortcuts
I used it quite well before. I don't need it for a while, and I forgot the shortcut keys. I have to read the manual again. I have to sort it out today and it will be easier to find it later.
ZC folding: only folding of the outermost layer
ZC folds all nested fold points in the range, including all nested folds.
Zo unfold and fold, only show the outer layer of the fold.
Zo expands all nested collapse points in the range, including nested collapse.
[Z to the start of the current fold.
] Z to the end of the currently opened fold.
ZJ moves down. To the start of the next fold. The closed folding is also included.
ZK moves up to the end of the previous fold. The closed folding is also
ZD Delete is the folding of the cursor. Valid only when 'foldmethod' is set to manual or marker.
ZD loop Delete refers to the folding under the cursor, that is, nesting Delete fold.
Valid only when 'foldmethod' is set to manual or marker.
Ze removes all folds in the (eliminate) window.
Valid only when 'foldmethod' is set to manual or marker.
Zfap moves the cursor to the section, and then press zfap to automatically add a folding label to the entire section.
Suppose you have created several folds, and now you need to read all the text. You can move to each fold and type "zo ". To make it faster, run the following command: Zr.
ZM
This will fold more (m-ore ). You can repeat "ZR" and "ZM" to open and close several layers of nested folding. Otherwise, you have to fold them one by one using ZC.
If you have a deep fold nested with several layers, you can use this command to open them all:
ZR
This will reduce the number of folds until there is no left. With the following command, you can disable all folds:
ZM
This will increase the fold until all folds are closed.
You can use the | Zn | command to quickly disable the folding function. Then | Zn | restore the original fold. | Zi | switch between the two
.