4

does anybody know how to perform a case insensitive file search with vim's plugin CtrlP? I can't seem to find that in the instructions anywhere. Ideally it would replace the standard CTRL+P shortcut.

Thank you!

Alexandr Kurilin
  • 7,685
  • 6
  • 48
  • 76

1 Answers1

7

The file search relies on the match function in VIM. To make the search case insensitive, simply issue the following command:

:set ignorecase

If you want this to be the default behaviour, you can add the command to your .vimrc file.

  • Thanks for your response. I remember reading somewhere that setting ignorecase permanently might be an issue for some vim functionality. For example, you turn it on for basic search (done with / and ?), but then it breaks some other really common scenario. Have you heard of that by any chance? – Alexandr Kurilin Nov 07 '11 at 23:07
  • Glad I could help. I have 'ignorecase' turned on by default and have a number of plugins (10+) running. I cannot recall having experienced any problems related to this matter, and I have not heard about anyone else complaining about the 'ignorecase' setting causing any issues either – but obviously, no guarantees. If you have more specific details on this, I would be interested to hear more about it. Cheers –  Nov 08 '11 at 19:45
  • 3
    Sorry to resurrect a dead thread, but another solution is to use smartcase. `:set smartcase` will match all cases until you specify a case, then it will become case sensitive. – wridgers Sep 30 '13 at 11:48