Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ok, so totally frustrated here. Running gvim (VIM - Vi IMproved 7.1 (2007 May 12, compiled May 27 2008 23:56:31). Have set up my .vimrc to have case insensitive search (set ic). ( No difference using .gvimrc either).

When vi'ing a file, over 50% of the time, it will only reflect case-sensitive searches. Sometimes closing current vi session, and re-opening will enable the ic option, but not always. Also trying to set it via the Files -> Global Settings -> Ignore Case does not help. So what the????

Any suggestions?

Current .vimrc contents:
set number
set bg=light
set ic
set smartcase
set autoindent
set mouse=a
syntax on
set ruler
set viminfo='10,\"100,:20,%,n~/.viminfo

share|improve this question
    
Your .vimrc also contains set smartcase. Maybe you're trying to search for a pattern, which contains uppercase letters? –  xaizek Aug 1 '12 at 21:27
    
No, just looking for plain old text, nothing special. As an example, searching for C++'s "main()" function, with Main will not locate it. It's crazy... –  bw1 Aug 2 '12 at 15:37
    
Okay, so it will work if and only if after opening the file, I use GVIM's Edit -> Global Settings -> Toggle Vi Compatible setting (but not if I do this myself within vi using :set cp!). –  bw1 Aug 2 '12 at 16:18
    
It's not crazy, it's what 'smartcase' option does. If at least one of pattern letters is an uppercase letter the case is not ignored (see :help 'smartcase'). And when you toggle vi compatibility the 'smartcase' option is reset as stated in the documentation. –  xaizek Aug 2 '12 at 17:11
    
I could understand that, however, I'd since commented out (") smartcase, and issue still exists.... –  bw1 Aug 2 '12 at 22:31
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.