Karthik Kashyap Thatipamula 写道:
Hi All,

I have multiple projects in my work directory and  for each project i
have a tags file.
In my vimrc i have an option to load my tags like
:set tags=./tags,tags,~/work/prj1/src/tags

Now i want to set this value dynamically depending on the project in
which i open the source file.
So if i open a file in ~/work/prj1/src/..  i should load the  ~/work/
prj1/src/tags file  and when i open a file in ~/work/prj2/src/... i
should load the ~/work/prj2/src/tags file.

How can i do this in vim.

Any pointers would be helpful.

If you change the current dir on file open, then you already get this feature by default.

If your project has subdirectories, do something like this:
set tags=./tags,tags,../tags,../../tags,../../../tags

This ensure you can go to tags in a parent directory.

All you need, is to ensure you go to the correct directory.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to