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
.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityLooking 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).