8/24/2006

贴一下我的.vimrc

在linux下面写c/c++程序,我习惯使用vim,下面是我喜欢的配置,具体含义可以 :help

~/.vimrc:

" vim:shiftwidth=4:tabstop=4:expandtab
set background=dark
set nobackup
set nowritebackup
set autoindent
set showcmd
set showmatch
set formatoptions+=mM
set noincsearch
set hlsearch
set wrap
set wrapscan
set ruler
set shiftwidth=4
set tabstop=4
set showmode
set novisualbell
set nonumber
syntax on
" Key mapping to stop the search highlight
nmap :nohlsearch
imap :nohlsearch
"Ctrl+p 添加注释信息
map ^P o/*Comment by hzy


" 编辑当前文件所在目录下的另一个文件
" 使用表达式来从当前文件路径中解析出路径
if has("unix")
map ,e :e =expand("%:p:h") . "/"
else
map ,e :e =expand("%:p:h") . "\\"
endif

"setup cscope automaticly
if has("cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif

没有评论: