So you know that
/ will bring up search in Vim and VSCode Vim. That's good!
But then you named a variable
is and now want to find every occurence of that word - but only where it stands alone. So no places where it occurs as part of your
isLargePizza() function for example.
Luckily, that's doable:
\< matches the beginning of a word and
\> the end.
So hitting ...
... will to the trick!
See this comment by @pbnj for additional tips relating to word boundary search.
Oldest comments (3)
:help *for additional related features.
#, vim will perform the same bounded word search going backward. Equivalent to
*, vim will perform the same bounded word search going forward. Equivalent to
This can be combined with other ways of searching in vim. For example:
:vimgrep /\<word\>/ %will perform bounded search for all instances of
wordand load the results in
:help quickfix-window. From there, you can navigate through the results with
: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.