Vim: ignore casing in search
webduvet

webduvet @webduvet

About: Software engineer always on the mission to learn something new.

Location:
Dublin, Ireland
Joined:
May 4, 2021

Vim: ignore casing in search

Publish Date: Jan 9 '23
1 0

escape sequence anywhere in the pattern \c

/\ccmake
Enter fullscreen mode Exit fullscreen mode

will match cmake and CMake or cMake

/c\cmake
Enter fullscreen mode Exit fullscreen mode

will match cMake and cmake but not CMake

the inverse of \c is \C

/\cc\CMake
Enter fullscreen mode Exit fullscreen mode

will match CMake and cMake but not cmake

further options:

This will ignore casing in all searching:

:set ignorecase
Enter fullscreen mode Exit fullscreen mode

unset with no prefix as usual:

:set noignorecase
Enter fullscreen mode Exit fullscreen mode

In addition to the above this will ignore casing if search string is all lowercase, but will be case sensitive if the search string contains any upper case letter. The ignorecase must me set.

:set smartcase
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment