How to search the tags file and load it automatically when vim start up

纵饮孤独 提交于 2019-12-04 11:22:10

问题


Vim is my favorite editor, when I open a php or python file in vim, the first command is:

set tags=../../../tags

or

set tags=../../tags

I think vim can do this automatically:

first search ./tags, if it is exists, set it, if not exists

search ../tags,if it is exists, set it, if not exists

search ../../tags,if it is exists, set it, if not exists

until it reaches the / or D: directory

However, I am not so familiar with the vim scripts. Any of your help will be appreciated!_


回答1:


There are a few comments on this particular subject on this question.

Basically, this is supposed to work:

set tags=./tags;/

It starts with a tags file in the current directory and goes up to the root directory.

Type :help tags-option for more details.



来源:https://stackoverflow.com/questions/6287743/how-to-search-the-tags-file-and-load-it-automatically-when-vim-start-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!