vim的配置文件,配置好以后就可以使用自己习惯的使用习惯了。强大的vim,强大的配置文件,我的只是冰山一角而已。以后随着自己的不断学习和使用,再慢慢添加。
set nocompatible
set numberset ruler
syntax on
syntax enable
set hlsearch
set incsearch
filetype plugin indent on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showcmd
set ignorecase "搜索时忽略大小写
"F2去除高亮
map <F2> :noh<cr>
"ctl+F9编译C程序
map <c-F9> :call CompileRunGcc()<cr>
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<.o"
endfunc
"F9运行C程序
map <F9> :exec "!./%<.o"<cr>
"ctl+F12生成tags文件
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
"Tlist的一些设置
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
set linebreak
"将头文件的路径加入到path中,使得vim能够找到头文件
set path+=/usr/include/c++/4.4
"将拼写建议的词数设置为5
set spellsuggest=5