1. vim
sudo apt-get install vim
vim /etc/vim/vimrc.local(内容如下)
=========================================================
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
colorscheme evening
=========================================================
2. cscope + taglist
sudo apt-get install exuberant-ctags cscope global
mkdir ~/.vim
下载taglist和cppcomplete并解压文件
=========================================================
taglist 的下载地址:
cppcomplete 的下载地址:
cscope_maps.vim的下载地址:
=========================================================
将下载解压后的文件cppcomplete.vim,taglist.vim和cscope_maps.vim拷贝到~/.vim/plugin中
安装了global后,最新4.8.6 以上版本有带vim的扩展,将它也拷贝到 ~/.vim/plugin
cp /usr/share/doc/global/examples/gtags.vim.gz ~/.vim/plugin
gzip -d gtags.vim.gz
修改cscope_maps.vim
nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i ^=expand("")$
nmap d :cs find d =expand("")
3. 环境搭建完毕后,就可以方便的使用了!
需要添加的文件列表:
/etc/vim/vimrc.local
~/.vim/plugin/cppcomplete.vim (from cppcomplete)
~/.vim/plugin/gtags.vim (from /usr/share/doc/global/examples/gtags.vim.gz)
~/.vim/plugin/taglist.vim (from taglist)
阅读(2745) | 评论(0) | 转发(0) |