jsfaint / gen_tags.vim

Async plugin for vim and neovim to ease the use of ctags/gtags
https://vim.sourceforge.io/scripts/script.php?script_id=5499
MIT License
312 stars 42 forks source link

[question] Can I use Gtags for jump instead of ctags? #59

Closed fcying closed 6 years ago

fcying commented 6 years ago

I test follow script, but not work

set cscopetag
set cscopeprg='gtags-cscope'
jsfaint commented 6 years ago

It's already set in gen_tags.vim https://github.com/jsfaint/gen_tags.vim/blob/e79c4af80cf77231949a03c2fcaa86f29c5df879/autoload/gen_tags/gtags.vim#L145-L146

It the GTAGS exists, ctrl-] jumps with GTAGS, if the tag can not be found, it will fallback to ctags

fcying commented 6 years ago

it not work, E257: cstag: tag not found GTAGS is exist, Ctrl+\ c can work. If I GenCtags, it can jump.

jsfaint commented 6 years ago

That's because some file that gtags can't generate definition for it. Which cause this issue, it's upstream issue, not issue in gen_tags.vim

ctrl+\ c works, that's because

Ctrl+\ c    Find functions calling this function

You should try, it should not work too

Ctrl+\ g    Find this definition
fcying commented 6 years ago

Ok, I understand. this is still a bit of a hassle, ctags still needs to be generated for jump(c-]), thanks for reply

jsfaint commented 6 years ago

You can use universal-ctags or pygments as the backend of gtags to generate the tags. But it looks universal-ctags and pygments don't support caller or reference querying.