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