Search for an exact word in Vim command mode

searchvim

I want to search for an exact word in Vim in command mode (using Vim command /wordtosearch, NOT the search of the current word at the cursor using * or # commands), e.g. I would like to search for an exact word say CIF but I do not want to find CIF_handle or CIF_drv.

How to make Vim search for exact word in the command mode?

(I don't mind the case of the word searched, because I already have ignorecase set.)

Best Answer

Use regular expressions:

/\<your_exact_word\>

In other words, enclose your search string between \< and \>

Related Question