valk
valk

Reputation: 9894

How to I find and jump to word in :tselect results?

I'm using VIM and Ctags, and when I want to jump to a definition I have a shortcut for :tselect. When the window with different matches opens, I would like to find some word with '/' but unfortunately that isn't working. Is that possible at all? Or, is there a better way than using Ctags?

Upvotes: 0

Views: 276

Answers (2)

romainl
romainl

Reputation: 196809

No. That window is not a regular window; it's just the command-line, where normal mode commands can't be used.

But you could use :ltag to populate the location list of the current window:

:ltag foo
:lwindow
/pattern

Here is a quick mapping that should make all that easier:

:nnoremap <key> :ltag  <bar>lwindow<S-Left><Left>

and a gifcast:

enter image description here

Upvotes: 2

valk
valk

Reputation: 9894

Following the suggestions in the answser, I replaced the Ctrl+] with this:

nnoremap <C-]> :ltag <c-r>=expand("<cword>")<cr><bar>lwindow<CR>

Now able to search through the results. Sweet :)

Upvotes: 0

Related Questions