tags:

views:

117

answers:

3

The vim command [I shows a list of declarations. How to do I navigate to one of the items in this list?

+1  A: 

As far as I know (and by briefly glancing at the manual) - that's not possible with those particular commands available.

However, you can use :vimgrep to sort of achieve what you're after e.g.:-

:vimgrep <C-R><C-W> %

And then just use the quickfix list to browse the matches as normal:-

:copen, :cnext, :cprev, etc.
Gavin Gilmour
A: 

Take note of the line numbers. You can use 100G to jump to line 100, 500G will jump to line 500, etc.

You could also just press * repeatedly to move through the matches (or # to move backwards).

too much php
+1  A: 

Hi,

The following snippet might be what you are looking for. It shows the list of declarations by [I and asks you in the same step to enter the number of the item you want to jump to:

nnoremap [I [I:let nr = input("Item: ")if nr != ''exe "normal " . nr ."[\t"endif

Greetings,

Jan Christoph

Jan Christoph Ebersbach