⭐ An IDE on top of Vim? Easy with "Vim From Scratch" book

Case-insensitive search in Vim

Published about 1 month ago.

In Vim, if you want to find a word in a text, you run /something, then hit enter and move between the results with n / p (see :help search-commands).

By default it's case-sensitive, so if you have a text like this:

This is something. Something is good. sOmEtHing!

It will only find the first something (with lowercase s).

Case-sensitive search in Vim

If you'd like to capture all occurrences no matter which case is used (case-insensitive search), you can append \c to your search pattern, like this:


Case-insensitive search in Vim

If you want this behavior by default, you can turn on the option:

set ignorecase

There's also a so-called "smartcase" (:help smartcase) which works as case-insensitive if you only use lowercase letters; otherwise, it will search in case-sensitive mode.

set smartcase

Vim From Scratch

Learn Vim and upgrade your productivity to the next level by building an IDE of your dreams.