Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to search a 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 an exact word say CIF but I do not want to find CIF_handle or CIF_drv..

How to make vim search exact word in the command mode?

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

Thank you.

-AD.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

One way to do this: /\<your_exact_word\>. In other words, enclose your search string between \< and >\

share|improve this answer
    
@Thanks: workd nicely. Does enclosing the word in \< .. \> make it a regex based search. –  goldenmean Oct 29 '10 at 10:19
    
Yes, it's a regex search. –  Janne Pikkarainen Oct 29 '10 at 10:22
    
But what do u do if u need to search for a string like "1...". It will highlight all numbers starting with 1 and not the string with the dots. –  inf.ig.sh Nov 9 '12 at 10:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.