2011-01-28 96 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查看我的標記更新。