Chinaunix首页 | 论坛 | 博客
  • 博客访问: 149047
  • 博文数量: 25
  • 博客积分: 406
  • 博客等级: 一等列兵
  • 技术积分: 330
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-15 01:18
文章分类

全部博文(25)

文章存档

2014年(1)

2013年(6)

2012年(10)

2011年(8)

分类: LINUX

2011-10-21 12:11:57

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)
      
阅读(2711) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~