@illuz
2014-07-30T12:15:36.000000Z
字数 935
阅读 2125
Linux
Someone's vimrc:
https://github.com/sk1418/myConf/blob/master/common/.vimrc
启用语法高亮度
:syntax enable
:syntax on
关闭语法高亮度
:syntax clear
:syntax off
设置文件类型为C语言
:set filetype=c
转换为HTML文件
:TOhtml
参考:http://yyq123.blogspot.com/2011/02/vim-syntax.html
set autoindent
set smartindent
set cindent
set shiftwidth=4
set tabstop=4
set softtabstop=4
参考:http://liuzhijun.iteye.com/blog/1831548
一句话说,就是自动根据你的文件类型,允许vim加载文件类型插件,为不同类型的文件定义不同的缩进格式。
相当于自动帮你设置filetype以及缩进。有了这句你就不用设置前面自动缩进了。
我的cpp自动模板就是靠的文件类型检测。
参考:http://easwy.com/blog/archives/advanced-vim-skills-filetype-on/
入门:http://haoxiang.org/2011/09/vim-modes-and-mappin/
详细文档:http://man.chinaunix.net/newsoft/vi/doc/map.html