evil icon indicating copy to clipboard operation
evil copied to clipboard

Add variable to prevent evil-change from inserting into kill-ring

Open NicholasBHubbard opened this issue 2 years ago • 3 comments

This PR adds a variable evil-change-prevent-kill-ring that if non-nil causes the text deleted from a call to evil-change to be stored in the void register by default.

NicholasBHubbard avatar Aug 12 '22 15:08 NicholasBHubbard

Thanks for the PR @NicholasBHubbard. Does this emulate a setting in vim? Have you considered advising evil-change? Something like this (only v briefly tested) could work:

(define-advice evil-change (:around (fn &optional beg end type reg yh df) reg-or-black-hole)
  (funcall fn beg end type (or reg ?_) yh df))

tomdl89 avatar Aug 16 '22 22:08 tomdl89

No it doesn't emulate a setting in vim (that I'm aware of). I use similar advise to what you provided in my own config, I just thought it may be useful for others to have the functionality available as a variable setting. I understand if you don't think this PR aligns with the goals of evil-mode.

NicholasBHubbard avatar Aug 17 '22 19:08 NicholasBHubbard

We certainly do have settings in evil where there is no corresponding setting in vim, but I think a good rule of thumb is to add them when there is demand from multiple people, otherwise our settings start to become a collection of odd hacks & tweaks from various users. I would say a couple of 👍s on this PR over the next couple of months would be enough to convince me to merge.

tomdl89 avatar Aug 19 '22 13:08 tomdl89