http://sourceforge.net/projects/vimcdoc/ vim中文文档
http://graceco.de/manual/cscope_vim_tutorial_zh.html cscope
vim + ctags +taglist
search taglist on www.sourceforge.net
sudo apt-get install ctags
创建tags
ctags * -R
解压taglist_45.zip
~/.vim/plugin/taglist.vim
把以下这一行加到taglist.vim中
let Tlist_Ctags_Cmd="/usr/bin/ctags"
如下:
let s:cpo_save = &cpo
set cpo&vim
let Tlist_Ctags_Cmd="/usr/bin/ctags"
if !exists('loaded_taglist')
" First time loading the taglist plugin
"
" To speed up the loading of Vim, the taglist plugin uses autoload
" mechanism to load the taglist functions.
" Only define the configuration variables, user commands and some
" auto-commands and finish sourcing the file
" The taglist plugin requires the built-in Vim system() function. If this
" function is not available, then don't load the plugin.
if !exists('*system')
打开vim导入tags
:set tags=/Users/peter/workspace/zxv10_vcs/i2c-tools-3.0.2/tags
打开符号表
:Tlist

几个有用的命令
ctrl + w w 在Taglist 和正常窗口之间切换 :split 2 把窗口分为上下两个 ctrl + w j 切换到下面的窗口 ctrl + w k 切换到上面的窗口 ctrl + ] 跳转到tag定义 ctrl + o 返回上一个位置 ctrl + i 前进到下一个位置 :ju -> 显示所有的可以跳跃的地方 (print jump list) :edit <filename> 打开编辑某个文档
cscope
Intall: sudo apt-get install cscope
Set key maps: wget http://cscope.sourceforge.net/cscope_maps.vim && mv cscope_maps.vim ~/.vim/plugin/
'cs add cscope.out' has also been included in this plugin.
find /my/project/dir -name '*.c' -o -name '*.h' > /foo/cscope.files cscope -b -i /foo/cscope.files
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage $0 <directory> [directory] ..."
echo
exit
fi
find $@ -name "*.h" \
-o -name "*.c" \
-o -name "*.cc" \
-o -name "*.cpp" \
-o -name "*.java"

本文介绍如何在Vim编辑器中配置和使用ctags和Cscope来提高代码导航效率。通过设置taglist.vim文件及安装ctags和Cscope,用户能够快速查找和定位代码中的符号定义。
727

被折叠的 条评论
为什么被折叠?



