4

Is there a built-in way in Vim to search for a pattern in a case-insensitive way, and substituting the occurrence conserving its case? (Something like an s/abcd/efgh that matches AbCd and replaces it with EfGh.)

3

There are ways to match characters case-sensitively, and replacement special forms that uppercase or lowercase their arguments, but there is not a native way to do that.

However, tpope has the excellent vim-abolish which provides a command :Subvert that can accomplish this

| improve this answer | |

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.