Unset ignorecase in vim?
VimVim 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.