vim + cscope + ctags + taglist配置

--------------------------------------------------

 ubuntu中如何将终端添加到右键?

在右键里面添加一个“打开终端”的菜单。
sudo apt-get install nautilus-open-terminal

--------------------------------------------------

Install Mannual(By CMM)

一、Install vim
sudo apt-get install vim (vim-full)
sudo apt-get install rar unrar p7zip-full
sudo apt-get install build-essential

二、In comand line, install cscop, ctags:
# sudo apt-get install cscop ctags


三、 taglist的安装和使用:
1. 在home目录下建立.vim文件夹,把taglist文件夹内的内容放入其中
2. 在home目录新建名为“.vimrc”的文件,并拷入以下内容:

set mouse=a
let Tlist_Use_Right_Window=1
let Tlist_File_Fold_Auto_Close=1
map <F4> :TlistToggle<CR>
noremap <F6> :make<CR>
noremap <S-F6> :make clean;make<CR>
noremap <F7> :Tlist<CR>
noremap <S-F7> :TlistSync<CR>
noremap <F3> :!./vitags.sh<CR>:cs reset<CR>
noremap <S-F3> :!cvs up<CR>
nnoremap <space> @=( ( foldclosed(line('.')) < 0 ) ? 'zc' : 'zo')<CR>
if has("multi_byte")
set encoding=utf-8
set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese
endif
set wrap
set hlsearch
filetype plugin on

colorscheme elflord
syntax on

set nocp
filetype plugin on
filetype indent on

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
set cscopetag
endif

set nu
set ts=4
set sw=4

set ru
set hls
set is
set sm
set cin
set cino=:0g0t0(sus

set autoread " read open files again when changed outside Vim
set incsearch " use incremental search
set nowrap " do not wrap lines
set nobackup
set nowritebackup
map <C-F12> :!ctags -R --c-kinds=+p --fields=+iaS --extra=+q .<CR>
map <C-F11> :!ctags -R .<CR>


现在再试试vim -t <函数名或宏等>,这时如果有多个选项的话就会出现一个列表让你选择你需要的那个。

一个好用的工具可以让你的工作效率大大提高,这里只是介绍了一点点,希望大家补充,纠正错误。

更多资料还可以看这里:
使用VIM开发软件项目-- 使用tag文件和taglist插件 (二)
http://www.360doc.com/content/10/0806/17/2555231_44139610.shtml

posted @ 2013-05-17 22:20  petercao  阅读(1410)  评论(0编辑  收藏  举报