← All lessons

8. Searching

Step 6 of 7

Case insensitive search

By default, Vim searches are case sensitive. A search like /A will only match A characters, not a. This behaviour isn’t always what you want.

Vim lets use override this with the ignorecase option. Use the command :set ignorecase to enable it, and :set noignorecase to disable it. With this turned on, Vim searches won’t be case sensitive.

Give this a go in the editor. There’s a few NEEDLE strings hidden amongst the HAYSTACK strings in the editor, but the NEEDLE strings are capitalised strangely, so you won’t be able to find them with just /NEEDLE. You’ll first have to enable the ignorecase option, then search for needle to find them.

Loading editor…