user16948
user16948

Reputation: 4951

Vim - ctags: tag not found

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?

Upvotes: 41

Views: 59865

Answers (4)

Ngoc Hoang Nguyen
Ngoc Hoang Nguyen

Reputation: 19

work for me

sudo apt-get install ctags
set tags=~/.vim/plugin

Upvotes: 0

Harish Gollavilli
Harish Gollavilli

Reputation: 1

I Faced the same problem few days ago. I was applying ctags shortcuts in a .c file and I was getting this error while doing so. I googled the error and found that the ctags was not installed. But the ctags is present in my server. I tried moving the ctag folder to the trunk which i'm currently working and this trick resolved my problem.

steps:

  1. go to your home folder and enter "where is ctags"
  2. it will display the path of the ctags file.
  3. copy that file and move the same to the directory which you are working in i hope this will resolve your issue.

Upvotes: 0

Habi
Habi

Reputation: 3300

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

Upvotes: 7

romainl
romainl

Reputation: 196546

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.

Upvotes: 72

Related Questions