Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?


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

share|improve this question
You answered your own question in the edit. – rahmu Mar 21 '13 at 7:35
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
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


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

Browse other questions tagged or ask your own question.