工作中常用的vim的配置,记录下来方便以后重新配置时使用
set nocompatible
if has("syntax")
syntax on
endif
set number
set shiftwidth=4
set tabstop=8
set foldcolumn=5
set cindent
set incsearch " 输入字符串就显示匹配点
set hlsearch
set nobackup
set swapsync=fsync
set noswapfile
nmap <C-c> :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-k> :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-l> :tselect <C-R>=expand("<cword>")<CR><CR>
nmap <Tab> gt
"set tags=/root/210/linux-3.0.8/tags
"cs add /root/210/linux-3.0.8/cscope.out /root/210/linux-3.0.8
做tags和cscope用的脚本
#!/bin/sh
echo "ctags ..."
ctags -R
echo "cscope ..."
find -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.cc'> cscope.files
cscope -bkq -i cscope.files