Chinaunix首页 | 论坛 | 博客
  • 博客访问: 300951
  • 博文数量: 43
  • 博客积分: 2071
  • 博客等级: 大尉
  • 技术积分: 488
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-25 17:48
文章分类

全部博文(43)

文章存档

2014年(5)

2013年(4)

2011年(9)

2010年(8)

2009年(17)

我的朋友

分类: LINUX

2009-09-02 12:12:09

下面的方法是如何在 ubuntu 环境里建立如同source insight 的代码浏览与编辑环境

1. 安装相关的应用程序
sudo apt-get install vim gvim
sudo apt-get install cscope
sudo apt-get install ctags

2. 解压并拷贝附件中的文档
2.1 unzip the attach file - vim-config-amuhong.tgz.
sudo tar zxvf vim-config-amuhong.tar.gz
then you can see one hiden file and one hiden folder.
derek:~/documents/vim-config-amuhong$ la
.vim  .vimrc

2.2 copy the unzipped file to the target folder.
copy the files to /home//

3. 修改 .bashrc 文件
3.1 please remember to add the below two lines to /home//.bashrc
alias mkctags='rm -f tags; find . -name "*.[ch]" -or -name "*.cpp" -or -name "*.java"  | ctags -L-'
alias mkcscope='rm -f cscope.in.out; rm -f cscope.out; rm -f cscope.po.out; find ./ -name "*.c" -or -name "*.h" -or -name "*.cpp" -or -name "*.java" -or -name "*.S" | cscope -Rbq'
3.2 and then reboot the terminal to enable what you have modified.

4. 如何使用
now you can enjoy what you have done.
for example, there is a code folder in /usr/src/souce
cd /usr/src/souce
mkctags;mkcscope
gvim code
now what you see should be like the interface of source insight.
you can refer to .vimrc file for the detailed usage.
for example
cs find g to find the define of this function.
cs find f to find a file.
and press some key such as F3/F4/F7/F8/... to enable/disable some windows.

文件:vim-config-amuhong.tar.gz
大小:82KB
下载:下载

 
阅读(898) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~