How to search in vim for a pattern that is NOT case sensitive

file searchvim

I occasionally search through files in vim or less using / or ? but as far as I can tell, the search patterns are case sensitive.

So for example, /foo won't find the same things that /FOO will. Is there an way way to make it less strict? How can I search in vim or less for a pattern that is NOT case sensitive?

Best Answer

In vi or vim you can ignore case by :set ic, and all subsequent searches will consider the setting until you reset it by :set noic. In less there are options -i and -I to ignore case.

Related Question