Gtags边写代码边跳转

问一下,怎么给emacs设置固定的tag ?,这样边写代码就可以边跳转了.

应该是不存在这样的 gtags。。。

你要让 gtags 支持代码跳转,每次你新写的 class 和函数是没办法跳转的,你必须重新生成 gtags。

另外,可以给你一些公共库生成 gtags,这样可以在你的项目里面跳转。

但是,想边写代码边跳转,直接用 imenu 就可以了,不同的文件中的跳转可以用 dumb-jump

我的意思是这样,比如我有个内核代码目录,~/linux-4.8.4.我在里面生成了tag.我就想让emacs默认去读这个tag.

设置这个变量 helm-gtags-path-style(Default 'root)

File path style, 'root or 'relative or 'absolute. You can only use 'absolute if you use Windows and set GTAGSLIBPATH environment variable. helm-gtags.el forces to use absolute style in such case.

然后配合 helm-gtags 去跳转

Reference: GitHub - emacsorphanage/helm-gtags: GNU GLOBAL helm interface

好的,我试试。

还是没搞定啊,我再试试吧.

vim 可以用set tags 来设置,不知道emacs怎么弄呢!

ctags 是可以很容易地设置的: How to use ctags in Emacs effectively | Chen's blog

不懂lisp真是不行啊,就这么简单的一条语句就搞定了. 哈哈.谢谢谢谢

这样设置以后到是能用了,但是加载tags文件的时候好慢,要等好久.