Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want the result to be highlighted when I search for it in a file.So,I opened a file with vi(version 7.2) and then used command :set hlsearch to enable highlighting.But even then I don't get my search results highlighted.Any idea what else to check ?

Edit

Now I tried same thing with vim and it works fine there.Is hlsearch only for vim ?

share|improve this question
1  
You answered your own question in the edit. –  rahmu Mar 21 '13 at 7:35
1  
vi should throw an error in that case. –  g4ur4v Mar 21 '13 at 7:47
    
In Linux, vi is a link to vim, but by default it is configured to compatibility mode which ignores most of the settings. –  David Kohen Mar 21 '13 at 9:36
1  
Do you have compatible set if you call vi? (i.e. what is the result of :set compatible?). –  jofel Mar 21 '13 at 9:43
    
I got the result nocompatible –  g4ur4v Mar 21 '13 at 12:56

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.