vim工具链环境搭建
2016-01-28 10:00
375 查看
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的下载地址:
http://cscope.sourceforge.net/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)
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的下载地址:
http://cscope.sourceforge.net/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)
相关文章推荐
- kmp算法
- 小小白初入编程江湖之初入职场迷茫篇
- static_cast、dynamic_cast、const_cast和reinterpret_cast总结
- Codeforces Round #340 (Div. 2) C. Watering Flowers
- 控制摄像头拍照(一)
- linux 性能测试
- 一种SpringMVC调用Javascript的方法
- Android 6.0: 动态权限管理的解决方案
- 工作流之-流程中设计到的表
- 微信公众号被动回复两条消息(一条正常,一条暂无法提供服务)
- bootstrap3 兼容IE8浏览器
- opencv基础知识-videowriter
- pdo_mysql安装
- svnserver配置文件详解一
- ToolBar
- 关于医院管理中书写的病志已提交删除问题
- 并发队列ConcurrentLinkedQueue和阻塞队列LinkedBlockingQueue用法
- Bug系列------------第一次开机结束无法使用home以及app_switch
- 数据缓存方案
- CI框架 -- 在视图文件中使用 PHP 替代语法