Unset ignorecase in vim?

Vim

Vim Problem Overview


:set ic ignores the case. How do you unset this?

Vim Solutions


Solution 1 - Vim

:set noic, or :set noignorecase

Really intuitive, right? :)

Solution 2 - Vim

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

Solution 3 - Vim

prefix searched string with "\C" (without quotes), eg:

/\Croot

Solution 4 - Vim

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkalView Question on Stackoverflow
Solution 1 - VimDave RayView Answer on Stackoverflow
Solution 2 - VimkykuView Answer on Stackoverflow
Solution 3 - VimyedpodtrzitkoView Answer on Stackoverflow
Solution 4 - VimPaulView Answer on Stackoverflow