Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this code open in vim:

$this->mockEvolve(...);

When I do a Ctrl + ] with my cursor over the m, it brings me to its definition.

However, when I run :ts when my cursor is over the m, vim shows me this list of tags:

  # pri kind tag               file
> 1 F   f    mockGet           <filename>
               public function mockGet(...)

I run into this problem a lot (not just with this function). Any ideas what's happening?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

The :help :tselect gives you the answer:

When [ident] is not given, the last tag name from the tag stack is used.

It uses the last jumped-to tag, not the word under the cursor. To insert that into the command-line, use Ctrl-R Ctrl-W.

share|improve this answer
2  
Wow, I just spent 3 months using :ts as though it listed all the tags under my cursor. A case of RTFM. Thanks so much! –  des4maisons Dec 14 '12 at 20:55
1  
If you like that behavior, you can define your own command for it: command! Tselect execute 'tselect' expand('<cword>') –  Ingo Karkat Dec 14 '12 at 21:11
    
I might just do that! –  des4maisons Dec 14 '12 at 21:21
1  
Also, try g] and g^]; they work like ^] (automatically using the keyword under/after the cursor), but use :tselect and :tjump (respectively) instead of :tag; :tjump is like :tselect, but skips the prompt if there is only one matching item. –  Chris Johnsen Dec 15 '12 at 5:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.