Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload tags file Vim

Tags:

How do i reload the tags file from within Vim?

Is a restart necessary?

like image 288
asymmetric Avatar asked Jan 28 '11 15:01

asymmetric


People also ask

How do I load a tag in Vim?

Using a Specific Tags File To use the tags file, you'll need to open Vim and tell it where it is. Still in the Vim source directory, I ran vim and then typed :set tags+=tags to tell it to use the ./tags file. At this point, Vim knows about the tags file — you don't need to tell it to load the file.

How do I set tags in Vim?

Select tag from tag list. You can select a particular tag from the tag list after opening the file in the vim editor by using ctags command. Open any source code in vim editor and type ':tselect' to find out the list of tag list of current source code. Here, the same file, abs_num.py is used to check this command.


1 Answers

According to :help tag-binary-search, the tags file is binary (or linear) searched on each lookup, so there's no need to reload the file:

                                                        *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. 
like image 169
jrdioko Avatar answered Oct 05 '22 02:10

jrdioko