Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim - ctags: tag not found

Tags:

vim

ctags

I want to use Ctags for a Zend framework project. I executed this command : ctags -R ./* ../ZendFramework/*to create a list of tags, but the problem is when I press Ctrl-] on a class or method I get this error: ctags: tag not found

I checked the tags file and all classes/methods/variables are listed. The tags files is located in the root of the project. Should I load it manullay when I open a file?

like image 264
user16948 Avatar asked Aug 15 '12 18:08

user16948


People also ask

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.


2 Answers

Yes, you should tell Vim where to find your tags file with something like:

:set tags=/path/to/tags

This is not very optimal, though. This line in your ~/.vimrc should help:

set tags=./tags,tags;$HOME

It tells Vim to look for a tags file in the directory of the current file, in the current directory and up and up until your $HOME (that's the meaning of the semicolon), stopping on the first hit.

like image 132
romainl Avatar answered Oct 16 '22 14:10

romainl


The 'tags' variable must point to your tags file. See :help 'tags'. An example to add the path to your tags file:

:set tags+=$HOME/yourpath/tags
like image 26
Habi Avatar answered Oct 16 '22 13:10

Habi