vim+ctags+taglist+cscope

3 篇文章 0 订阅
2 篇文章 0 订阅

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"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值