tags:

views:

1107

answers:

3

:set ic ignores the case, how do you unset this?

+8  A: 

:set noic, or :set noignorecase

Really intuitive, right? :)

Dave Ray
In Vi I'm pretty sure you can also use :set noic (which is more intuitive)
Jason Down
Sure,but even more intuitive, to me anyway, would be :unset ic. I guess I'll keep using vim anyway :)
Dave Ray
Yes, that would be even nicer =)
Jason Down
":help set" will tell you all about the :set command, including :set no{command} to unset a boolean, and even :set {command}! which toggles it
Gareth
Cool, so you could do :set ic! to toggle it then?
Jason Down
Yep, :set ic? confirms that :set ic! toggles between "ignorecase" and "noignorecase"
Adam Bellaire
+3  A: 

You can also toggle the setting with :set ic! and query its value with :set ic?

kyku
A: 

Pay attention to 'smartcase' option. It overrides the 'ignorecase' option if the search pattern contains upper case characters.

i.e. having 'ignorecase' and 'smartcase' on /foo will find foo, Foo and FOO, but /Foo will find only Foo, not foo.

You can also tell Vim that you want to search case-sensitive despite of 'ignorecase' setting by using \C somewhere in the search pattern. By using \c in the search pattern you tell Vim to ignore case while searching, despite of 'ignorecase' setting.

Paul