Thursday, November 01, 2012

Search case in/sensitve, 'ignorecase' regardless

I found it always bit clumsy that when I want to search case sensitive/case insensitive, I had to flip the 'ignorecase' option.

As it turned out, there is much much simple way: an 'ignorecase' override, right in the search pattern itself. Here it is.

Case insensitive search (as if 'noignorecase'):

/\CPORT

Case sensitive search (as if 'ignorecase'):
/\cPORT
First would find only "PORT" while the second would find also "port" and "Port". Easy peasy.

See more at :h /\c and :h /character-classes.


P.S. Blogspot seems to be too devastated by the storm Sandy bunch of monkeys Google's Web design team. (Now YouTube too.) A major redesign, but again without single improvement to the substance of the blogging platform.