1

How do I make %s/x/y/gc use case insensitive matching but do case sensitive replaces?

In emacs terms, I want case-fold-search but not case-replace.

HappyFace
  • 751
  • 4
  • 16

1 Answers1

2

Looking at the code of evil-ex-substitute (using C-h f), the value for case-replace is set to the value of case-fold-search in the let* form.

So it looks like there is no configuration option provided for this by default. But of course you can just replace the case-fold-search with (not case-fold-search) after the case-replace in that let* and (re)evaluate the evil-ex-substitute function definition.

NOTE how the value of case-fold-search is set via evil-ex-pattern-ignore-case. This a.o. means that you can use vim style patterns to set the value for case-fold-search (using \c/\C as explained e.g. in this SE-answer).

dalanicolai
  • 6,108
  • 7
  • 23