Evil mode and use it all the time with my Emacs configuration.
One thing I often do is copy some text with
y and select some text in
visual mode followed by using
P to replace it with what I have just copied.
However what really annoys me is that every time after I press
the content(ie. visual selection) being replaced is saved to the top of
kill-ring which ruined my next paste operation with
kill-ring has been changed.
After consulting the helpful, it shows that command invoked for pasting in visual mode is
evil-visual-paste defined in
Skimming through the function, this line is what I’m looking for:
(when evil-kill-on-visual-paste (kill-new new-kill))
Basically it will save whatever in visual selection and push it to the top of
kill-ring if variable
evil-kill-on-visual-paste is true.
This variable is defined here as following (in
(defcustom evil-kill-on-visual-paste t "Whether ~evil-visual-paste' adds the replaced text to the kill ring, making it the default for the next paste. The default, t, replicates the default vim behavior." :type 'boolean :group 'evil)
So by setting this variable to false that annoyance goes away:
(setq evil-kill-on-visual-paste nil)