vim语法高亮、语法提示、自动对其配置

jopen 11年前

需要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