Introduction to VIM Code folding commands

Source: Internet
Author: User
Tags diff

  Zhanhailiang Date: 2014-10-18

1. Implementing code Folding via FDM: Set fdm=xxx

|fold-manual|    Manual folds is created manually.   |fold-indent| Indent Lines with equal indent form a fold.     |fold-expr| Expr ' foldexpr ' gives the fold level of a line.|   fold-marker| Marker markers is used to specify folds.|   Fold-syntax| Syntax syntax highlighting items specify folds.|     Fold-diff|     Diff Fold Text that is not changed. 

2. Configure set Fdm=syntax to collapse as a syntax block:

[Root@~/Wade/Codereview/redis-2.8.17/Src]# cat ~/.VIMRCSetNocompatibleSetNu""Ctagsmap<C-f12>:!Ctags- R--c++-kinds=+p--fields=+ias--extra=+q.<CR>""TagList Let Tlist_show_one_file=1 Let Tlist_exit_onlywindow=1Nnoremap<F8>: Tlisttoggle<CR> ""Code FoldingSet FDM=syntax

3. Folding Basic Shortcut key Description:

ZC     Folding Zc     collapses all nested collapsed points within the range Zo     expand collapse zo     all nested collapsed points within the range expand [Z to the beginning of the     currently open collapsed]z to the end of the     currently open collapsed ZJ     Move Down. arrives at the beginning of the next collapse. Closed folds are also counted into the ZK     to move up to the end of the previous fold. Closed folds are also counted into the

Introduction to VIM Code folding commands

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.