重新加载标签文件Vim

时间:2011-01-28 15:18:34

标签: vim tags ctags

如何从Vim中重新加载tags文件?

是否需要重启?

3 个答案:

答案 0 :(得分: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.

答案 1 :(得分:4)

据我所知,Vim 7.3一旦生成就不会使用tags文件。

答案 2 :(得分:1)

我发现在另一个缓冲区/标签中加载标签文件会有所帮助。然后我可以使用:e!重新加载该缓冲区以获取vim以查看我的标记更新。