I can search word in vim with /word
. How can I search only for word
, excluding searches for word1
and word2
?
Searching word in vim
vim
Related Topic
- Vim clear last search highlighting
- Your most productive shortcut with Vim
- What’s a quick way to comment/uncomment lines in Vim
- How to do case insensitive search in Vim
- Turning off auto indent when pasting text into vim
- Git – How to make Git use the editor of the choice for commits
- How does the vim “write with sudo” trick work
- How to exit the Vim editor
Best Answer
like this:
\<
means beginning of a word, and\>
means the end of a word,Adding @Roe's comment:
VIM provides a shortcut for this. If you already have word on screen and you want to find other instances of it, you can put the cursor on the word and press
'*'
to search forward in the file or'#'
to search backwards.