找回密码
 立即注册

QQ登录

只需一步,快速开始

华强北商行 门户 Linux/Unix 查看主题

Vim代码折叠命令简介

发布者: yh6788 | 发布时间: 2014-11-6 13:57| 查看数: 3055| 评论数: 0|帖子模式

1. 通过fdm实现代码折叠:set fdm=xxx
有以下6种方式实现折叠:
|fold-manual|   manual      Folds are 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 are used to specify folds.
|fold-syntax|   syntax      Syntax highlighting items specify folds.
|fold-diff|     diff        Fold text that is not changed.     2. 如下配置set fdm=syntax以语法块实现折叠:
[root@~/wade/codeReview/redis-2.8.17/src]# cat ~/.vimrc
set nocompatible
set nu

"" ctags
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
"" taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
nnoremap <F8> :TlistToggle<CR>

"" 代码折叠
set fdm=syntax3. 折叠基本快捷键说明:
zc     折叠
zC     对所在范围内所有嵌套的折叠点进行折叠
zo     展开折叠
zO     对所在范围内所有嵌套的折叠点展开
[z     到当前打开的折叠的开始处
]z     到当前打开的折叠的末尾处
zj     向下移动。到达下一个折叠的开始处。关闭的折叠也被计入
zk     向上移动到前一折叠的结束处。关闭的折叠也被计入

最新评论

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

 
 
加好友78950405
QQ臨時會話
華強北商行笔记本,手機
淘宝阿里旺旺
沟通交流群:
水货thinkpad笔记本
工作时间:
11:00-22:00
电话:
18938079527
微信联系我们
公告:
深圳市区免费送货服务重新上线

QQ| 华强北商行 ( 粤ICP备17062346号 )

JS of wanmeiff.com and vcpic.com Please keep this copyright information, respect of, thank you!JS of wanmeiff.com and vcpic.com Please keep this copyright information, respect of, thank you!

|网站地图 公司简介 联系方式 版权所有@

GMT+8, 2024-4-30 15:32 , Processed in 0.027312 second(s), 22 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表