vim工具链环境搭建

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

3. taglist和cppcomplete
    taglist 的下载地址:
    http://www.vim.org/scripts/script.php?script_id=273

     cppcomplete 的下载地址:
     http://www.vim.org/scripts/script.php?script_id=527

     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 <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> 

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)





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值