1. Install software.
$brew install vim
$brew install cscope
$brew install ctags
2. ~/.vimrc
syntax on
filetype on
set ru
set backspace=indent,eol,start
set whichwrap=b,s,<,>,[,]
set nocompatible
set number
set history=1000
set background=dark
set autoindent
set smartindent
set expandtab
set tabstop=4
set shiftwidth=4
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
set cindent
set incsearch
let Tlist_Auto_Open=1
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
colorscheme evening
3. cscope+taglist
taglist 的下载地址:
http://www.vim.org/scripts/script.php?script_id=273
cscope_maps.vim的下载地址:
将下载解压后的文件cppcomplete.vim,taglist.vim和cscope_maps.vim拷贝到~/.vim/plugin中
修改cscope_maps.vim
nmap <F5>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <F5>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <F5>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <F5>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <F5>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <F5>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <F5>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <F5>d :cs find d <C-R>=expand("<cword>")<CR><CR>