Vim Tips: Folding shortcut keys

Source: Internet
Author: User

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

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.