I like autochdir
a lot, but it breaks my tag browsing, e.g.:
main.c:
int main(){}
d/a.c:
int main(){}
vimrc:
set nocompatible
set autochdir
set tagrelative
set tags=tags;
tags:
main d/a.c /^int main() {}$/;" f
main main.c /^int main() {}$/;" f
generated with ctags -R
.
Now:
vim -u vimrc main.c
:tag main
Then this works fine and goes to d/a.c
:
:tn
However this fails as it searches for main.c
:
:tp
and :ts
shows relative paths.
I suppose the problem is that :pwd
is d/
, and the path it looks for is just main.c
which is not present in d/
.
Even more confusing to me, if I do:
vim -u vimrc d/a.c
then everything works, and :ts
shows absolute paths.
How to solve this? Why isn't tagrelative
helping?
vim 8.0, Ubuntu 17.04.
ctags
asctags -R $PWD
, which should put absolute paths intotags
file.