sodu vim /usr/share/vim/vimrc
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins
自动添加#include
function InsertIncludeFileI()
let sourcefilename=expand("%:t")
let outfilename=substitute(sourcefilename,'\(\.[^.]*\)$','.h','g')
call setline('.','#include "'.outfilename.'"')
endfunction
imap <c-b><c-h> <ESC>:call InsertIncludeFileI()<CR>
function InsertIncludeFileN()
let sourcefilename=expand("%:t")
let outfilename=substitute(sourcefilename,'\(\.[^.]*\)$','.h','g')
call setline('.','#include "'.outfilename.'"')
endfunction
nmap ,hh :call InsertIncludeFileN()<CR>