Perform case insensitive searches in vi or vim

Contributor Icon Contributed by qmchenry Date Icon February 17, 2004  
Tag Icon Tagged: 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:

:set noignorecase

Previous recipe | Next recipe |
 
  • Drakonen
    or, you can use
    /expressionc
  • Anonymous
    This is a wonderfull tip. Just found out that set noigorecase can also be abbreviated as set noic.
blog comments powered by Disqus