我在/ -R /ntopng目录下的c++中的项目上执行了ctags。现在,当我使用cscope -R启动cscope并搜索main.cpp时,它会打开。但是,当我在main.cpp中的#include "ntop-includes.h“上点击ctrl-]时,错误消息是tag not found。头文件位于/project/ntopng/include中的一个子目录中。但是,ctags是递归的,所以为什么我会得到一个错误?我使用的是Ubuntu 12.04和最新版本的ctag和cscope。谢谢。
发布于 2013-10-10 21:14:44
对于Ubuntu 12.04,我给出了以下答案
1. Open any file with vim
2. type :echo &tags ,It will show what path vim is using for tags file.如果不是预期的标记文件路径类型::set tags=path_to_your_tag_file (ex /project/ntopng/tags)
请记住,它只对当前会话有效,现在如果需要永久更改,有两个选项。
对于所有用户(需要root权限) --
1. cd /etc/vim
2. vim vimrc
3. Go to end and add set tags+=tags;path_to_your_tag_file对于单个用户:
1. cd ~
2. vim .vimrc (This file may not exists in that case newly created)
3. set tags+=tags;path_to_your_tag_file让我知道它是否对你有效。
https://stackoverflow.com/questions/18962037
复制相似问题