3

Currently when I select a bit of text replacing another bit of text (eg "viwp" to paste over the current word) it copies the thing I just replaced into kill ring. So if I try to paste over another bit it has lost the original thing I copied and instead pastes the thing I previously replaced. Obviously I can cycle through the kill ring but that's fiddly and a total pain.

Any idea what variables to look at? I think this happened when I upgraded evil-mode.

Thomas Parslow
  • 203
  • 1
  • 5
  • This is probably related to `delete-selection-mode`, but I'm not sure how to get the behavior you want. Use `M-x find-library RET delsel RET` to take a look at the code. – nanny Feb 18 '15 at 21:47
  • delsel isn't loaded but I think it's just standard evil-mode behavior to delete selection before pasting. What I don't want is for that selection to end up in the kill-ring. – Thomas Parslow Feb 20 '15 at 10:42

2 Answers2

3

Came across this while Googling for a solution to this problem. What I found to work is part of the Spacemacs FAQ:

(fset 'evil-visual-update-x-selection 'ignore)

See also: https://emacs.stackexchange.com/a/15054/84

1

That is evil's default behaviour, parallel to VIM. The variable to change this behavior is: evil-kill-on-visual-paste.

To discard the overwritten text:

(setq evil-kill-on-visual-paste nil)