1

Basically:

cat -> horse
CAT -> HORSE
Cat -> Horse

I know this is underspecified (e.g. unclear what cAt should become). However, is there a canonical solution for this?

2

The vim-abolish plug-in implements a :Subvert command that performs substitutions taking case in consideration. (It can also preserve plurals, including exceptions in plural forms.)

See the README file with examples, specifically on case:

Oh, but the case variants!

:%s/Facility/Building/g
:%s/FACILITY/BUILDING/g

[...]

Abolish.vim has your back. One command to do all six, and you can repeat it with & too!

:%Subvert/facilit{y,ies}/building{,s}/g

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.