vim語法高亮、語法提示、自動對其配置
需要vim版本在7.0或者以上。
編輯配置文件,一般為(/etc/vimrc)
syntax on
set ts=4
set autoindent
set smartindent
set cindent shiftwidth=4
set softtabstop=4
autocmd FileType c set expandtab
autocmd FileType cpp set expandtab
autocmd FileType php set expandtab
autocmd FileType python set expandtab
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set is
hi Comment ctermfg=blue //修改注釋顏色//grey灰色
二、語法提示
.vimrc文件
1.autocmd FileType python set omnifunc=pythoncomplete#Complete
2.autocmd FileType javascrīpt set omnifunc=javascrīptcomplete#CompleteJS
3.autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
4.autocmd FileType css set omnifunc=csscomplete#CompleteCSS
5.autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
6.autocmd FileType php set omnifunc=phpcomplete#CompletePHP
7.autocmd FileType c set omnifunc=ccomplete#Complete