How to use [I in vim

The vim command [Idisplays a list of declarations. How to go to one of the items in this list?

+3
source share
3 answers

As far as I know (and a brief look at the manual) - this is not possible with these specific commands.

However, you can use : vimgrep to achieve what you want, for example: -

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

And then just use the quick fix list to see the matches as usual: -

:copen, :cnext, :cprev, etc.
+2
source

Pay attention to line numbers. You can use 100Gto go to line 100, 500Ggo to line 500, etc.

* , ( # ).

+1

The following snippet may be what you are looking for. It displays a list of ads [Iand asks you at the same step to enter the number of the element you want to go to:

nnoremap <silent> [I [I:let nr = input("Item: ")<Bar>if nr != ''<Bar>exe "normal " . nr ."[\t"<Bar>endif<CR>
+1
source

Source: https://habr.com/ru/post/1739209/


All Articles