下面的方法是如何在 ubuntu 环境里建立如同source insight 的代码浏览与编辑环境
1. 安装相关的应用程序sudo apt-get install vim gvimsudo apt-get install cscopesudo apt-get install ctags2. 解压并拷贝附件中的文档2.1 unzip the attach file - vim-config-amuhong.tgz.
sudo tar zxvf vim-config-amuhong.tar.gzthen you can see one hiden file and one hiden folder.
derek:~/documents/vim-config-amuhong$ la.vim .vimrc2.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 |
下载: | 下载 |
|
阅读(921) | 评论(0) | 转发(0) |