Perform Case Insensitive Searches in Vi or Vim

Posted February 17, 2004 by Quinn McHenry in UNIX

The default behavior of searches in vi/vim is case sensitive. A simple setting allows case insensitive searches.


By default, the following search string entered in command mode will find only instances of Tech-Recipes which match the upper and lower case exactly:

/Tech-Recipes

To ignore case in the searches, enter the following command:

:set ignorecase

This command can be abbreviated :set ic. To turn off this feature, use the following:

:set noignorecase

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.