ludovicchabant / vim-gutentags

A Vim plugin that manages your tag files
https://bolt80.com/gutentags/
MIT License
2.3k stars 174 forks source link

Relative path in tags file #176

Open meijieru opened 6 years ago

meijieru commented 6 years ago

vim-gutentags always generate abspath in tags file. How can I generate relative path instead?

ludovicchabant commented 6 years ago

The way ctags chooses how to generate relative or absolute paths is rather convoluted, different between version of ctags (exhuberant, universal, etc.), and I still don't fully grasp it myself... but I believe that if you use the default settings and don't use the central cache (i.e. you let the tags file end up at the project's root), it should use relative paths.

wangrongwei commented 3 years ago

whether the following code is to realize relative path in tags file?

if l:use_tag_relative_opt
    let l:cmd += ['-O', shellescape("--tag-relative=yes")]
endif

but I have tried, and not works.

update: I have tried to modify some code, but it seems that can not only show abspath (i,e. :ts in vim) when the tags file in other dir.