Vim tips: Collapse shortcuts

Source: Internet
Author: User
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
.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.