See :help # and :help * for additional related features.
For example:
Place the cursor on a word and press #, vim will perform the same bounded word search going backward. Equivalent to ?\<word\>.
Place the cursor on a word and press *, vim will perform the same bounded word search going forward. Equivalent to /\<word\>.
This can be combined with other ways of searching in vim. For example: :vimgrep /\<word\>/ % will perform bounded search for all instances of word and load the results in :help quickfix-window. From there, you can navigate through the results with :copen, :cnext, :cprev, to open the list, go to next result, or go to previous result respectively.
Nice.
See
:help #
and:help *
for additional related features.For example:
#
, vim will perform the same bounded word search going backward. Equivalent to?\<word\>
.*
, vim will perform the same bounded word search going forward. Equivalent to/\<word\>
.This can be combined with other ways of searching in vim. For example:
:vimgrep /\<word\>/ %
will perform bounded search for all instances ofword
and load the results in:help quickfix-window
. From there, you can navigate through the results with:copen
,:cnext
,:cprev
, to open the list, go to next result, or go to previous result respectively.These are great tips, thanks!
I added a reference to your comment to the end of the post.