vim也是有代码折叠功能
来源:互联网 发布:java语言培训 编辑:程序博客网 时间:2024/05/22 06:49
vim也是有代码折叠功能的,以前就知道,然而毕竟用的不多,这个功能基本上很少用。随着最近和gvim的亲密接触,对代码折叠功能逐渐熟悉起来。有一次打开一段php的代码 — 比如PEAR.php,发现里面的代码自动被折叠了,将代码展开后,可以看到只要代码两边有/*{{{*/和/*}}}*/,就会被自动折叠。仔细搜索配置,其中有一句是重点:
foldmethod=marker
这样vim就会自动搜索代码,将{{{和}}}之间的内容折叠起来,而且代码结尾有一段小注释也不是无用的废料:
/*
* Local Variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* End:
*/
http://my.tv.sohu.com/pl/5801006/index.shtml
http://my.tv.sohu.com/us/165182489/59781263.shtml
http://my.tv.sohu.com/us/165182489/59781234.shtml
http://my.tv.sohu.com/us/165182489/59781270.shtml
http://my.tv.sohu.com/us/165182489/59781274.shtml
http://my.tv.sohu.com/us/165182489/59781862.shtml
http://my.tv.sohu.com/us/165182489/59781909.shtml
http://my.tv.sohu.com/us/165182489/59781862.shtml
http://my.tv.sohu.com/pl/5801005/index.shtml
http://my.tv.sohu.com/us/165182489/59781923.shtml
http://my.tv.sohu.com/us/165182489/59781681.shtml
http://my.tv.sohu.com/us/165182489/59782018.shtml
http://my.tv.sohu.com/pl/5801009/index.shtml
http://blog.sina.com.cn/u/3704119565
http://t.sohu.com/u/1656422894
http://my.tv.sohu.com/user/165182489
http://t.sohu.com/m/9494392308
这段注释会被vim读取,并自动设置到环境变量里面。
关于代码折叠的用法,只要在vim中输入:
:help zo
就可以看到了不少相关的快捷键,需要一定的练习才可以得心应手:)
我的gvim配置内容又增加了:
colo zellner
set guifont=Courier_New:h11:cANSI nobackup tabstop=4 shiftwidth=4 foldmethod=marker
au BufRead * simalt ——x
一点 vim相关小发现:
google reader的上一篇,下一篇快捷键分别是j,k,和vim的光标移动键一致,不知道是巧合还是有意为之,如果是后者,那么google reader的开发者想必也是vim的粉丝:)
使用Firefox查看网页源代码时,按一下”/”,会显示搜索框,与vim的搜索一致,估计firefox的开发者也是vim爱好者:p
foldmethod=marker
这样vim就会自动搜索代码,将{{{和}}}之间的内容折叠起来,而且代码结尾有一段小注释也不是无用的废料:
/*
* Local Variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* End:
*/
http://my.tv.sohu.com/pl/5801006/index.shtml
http://my.tv.sohu.com/us/165182489/59781263.shtml
http://my.tv.sohu.com/us/165182489/59781234.shtml
http://my.tv.sohu.com/us/165182489/59781270.shtml
http://my.tv.sohu.com/us/165182489/59781274.shtml
http://my.tv.sohu.com/us/165182489/59781862.shtml
http://my.tv.sohu.com/us/165182489/59781909.shtml
http://my.tv.sohu.com/us/165182489/59781862.shtml
http://my.tv.sohu.com/pl/5801005/index.shtml
http://my.tv.sohu.com/us/165182489/59781923.shtml
http://my.tv.sohu.com/us/165182489/59781681.shtml
http://my.tv.sohu.com/us/165182489/59782018.shtml
http://my.tv.sohu.com/pl/5801009/index.shtml
http://blog.sina.com.cn/u/3704119565
http://t.sohu.com/u/1656422894
http://my.tv.sohu.com/user/165182489
http://t.sohu.com/m/9494392308
这段注释会被vim读取,并自动设置到环境变量里面。
关于代码折叠的用法,只要在vim中输入:
:help zo
就可以看到了不少相关的快捷键,需要一定的练习才可以得心应手:)
我的gvim配置内容又增加了:
colo zellner
set guifont=Courier_New:h11:cANSI nobackup tabstop=4 shiftwidth=4 foldmethod=marker
au BufRead * simalt ——x
一点 vim相关小发现:
google reader的上一篇,下一篇快捷键分别是j,k,和vim的光标移动键一致,不知道是巧合还是有意为之,如果是后者,那么google reader的开发者想必也是vim的粉丝:)
使用Firefox查看网页源代码时,按一下”/”,会显示搜索框,与vim的搜索一致,估计firefox的开发者也是vim爱好者:p
- vim也是有代码折叠功能
- vim代码折叠功能
- vim代码折叠功能
- Vim技巧#Vim foldmethod代码折叠功能
- VIM折叠功能小结
- vim的折叠功能
- vim的折叠功能
- vim中的折叠功能
- vim代码折叠indent折叠,maker折叠
- VIM设置代码折叠
- VIM设置代码折叠
- Vim 6.0 代码折叠
- VIM设置代码折叠
- VIM设置代码折叠
- VIM设置代码折叠
- VIM设置代码折叠
- VIM 代码折叠
- vim折叠代码
- pygame编写贪吃蛇
- 峰均比,PAR( Peak-to-Average Ratio)
- 单链表应用——逆序输出单链表中的元素
- servlet
- Introdution to Stacks
- vim也是有代码折叠功能
- fatal error LNK1112: 模块计算机类型“X86”与目标计算机类型“x64”冲突
- 高校特种设备管理系统源代码
- 编程小结之代码规范——代码的格式化
- A Knight's Journey
- 庄子识人九征
- Oracle初学者入门指南-什么是Metalink -MOS ?
- hdu/hdoj 1130 How Many Trees?
- KMP算法通俗讲解