Jeenu
Jeenu

Reputation: 2231

Relative paths in tag file

If a tags file contains relative paths, Vim attempts to locate the source file relative to the location where the tag file itself lies, not from the current directory. I.e. the tag file must lie where ctags -R was run from.

Any way to get Vim to locate the source file from the PWD, in case I want to keep the same tag file elsewhere?

Upvotes: 4

Views: 2358

Answers (2)

pokey
pokey

Reputation: 108

Add set notagrelative to your .vimrc file. Quoting from here:

'tagrelative' - Controls how the file names in the tags file are treated. When on, the filenames are relative to the directory where the tags file is present.

Upvotes: 8

gzh
gzh

Reputation: 3596

you can use :set tags=/path/to/your/tagfiles to load tags files from any directory.

Upvotes: 0

Related Questions