2011-01-28 132 views
18

如何从Vim内加载tags文件?重新加载标签文件Vim

是否需要重新启动?

+0

无需重新加载它,vim不会将它保存在内存中。每次您要查找标签时,它都会对文件执行一些二进制搜索。 – Benoit 2011-01-28 15:26:45

+0

几天之前,我必须做Vim重新启动才能使新的`tags`文件生效。 Vim版本:`7.2` – 2012-04-08 06:50:51

回答

17

:help tag-binary-search,标签是二进制文件(或线性)搜索各个查找,所以没有必要重新加载该文件:

             *tag-binary-search* 
Vim uses binary searching in the tags file to find the desired tag quickly 
(when enabled at compile time |+tag_binary|). But this only works if the 
tags file was sorted on ASCII byte value. Therefore, if no match was found, 
another try is done with a linear search. If you only want the linear search, 
reset the 'tagbsearch' option. Or better: Sort the tags file! 

Note that the binary searching is disabled when not looking for a tag with a 
specific name. This happens when ignoring case and when a regular expression 
is used that doesn't start with a fixed string. Tag searching can be a lot 
slower then. The former can be avoided by case-fold sorting the tags file. 
See 'tagbsearch' for details. 
4

据我所知,没有必要Vim 7.3一旦生成就使用tags文件。

0

我觉得它有助于只加载在另一个标签文件缓冲器/标签。然后,我可以使用:e!重新加载该缓冲区,让vim查看我的标记更新。