[10]Make Vim as Your C/C++ IDE in Debian

本文介绍如何通过安装和配置Vim编辑器及其插件来创建一个高效的C/C++开发环境。步骤包括安装Vim及必要的插件如vimplugin.c.vim,设置ctags以便快速导航代码,安装TagList插件进行标签管理,并利用cscope加强代码搜索功能。

1. install vim and vim-gnome

sudo apt-get install vim
sudo apt-get install vim-gnome

2. install vim plugin c.vim

download cvim.zip from http://www.vim.org/scripts/script.php?script_id=213

if there already have ~/.vim, unzip cvim.zip and copy the files to ~/.vim matched folders.
otherwise

 

$ mkdir ~/.vim
$ cd 
~/.vim
$ unzip cvim.zip
Add the following line to the ~/.vimrc to enable the plugin for Vim editor.
$ vim ~/.vimrc
filetype plugin on

for details,following

http://www.thegeekstuff.com/2009/01/tutorial-make-vim-as-your-cc-ide-using-cvim-plugin/

 

3.install ctags

 downloadhttp://ctags.sourceforge.net/

tar -xvjpf ctags-5.8.tar.gz

install from source code.

$ tar -xzvf ctags-5.8.tar.gz
$ cd ctags
-5.6
$ .
/configure
$ make
# sudo make install  
:set tags=/home/mark/vim71/tags

or set tags in  ~/.vimrc. Now can go the the routine using Ctrl+] and back using Ctrl+T

 4.TagList

download TagList from http://vim-taglist.sourceforge.net/

unzip taglist_45.zip

 

copy the files in doc and plugin to ~/.vim matched folders

 

 

Add the following line to the ~/.vimrc

let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow
=1

and start vim taglist window

:Tlist

5 WinManager

http://www.vim.org/scripts/script.php?script_id=95 
unzip winmanager.zip in ~/.vim

 

open folder using :e ~/vim71

add  to 

~/.vimrc

 

let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle
<cr>

6. install cscope

sudo apt-get install cscope

add following lines to ~/vimrc 

set cscopequickfix=s-,c-,d-,i-,t-,e-
cd /home/pathofsourcefile
cscope 
-Rbq


cs add /home/pathofsourcefile/cscope.out /home/pathofsourcefile

 


 


 



 

 

 

转载于:https://www.cnblogs.com/smartvessel/archive/2011/01/10/1932318.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值