Rename +evil/paste-preserve-register => +evil/alt-paste

Now does the invers of evil-kill-on-visual-paste
This commit is contained in:
Henrik Lissner 2019-12-21 03:59:46 -05:00
parent 8562fc0aa3
commit baae6b1711
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 5 deletions

View file

@ -31,11 +31,12 @@
(evil-visual-restore)) (evil-visual-restore))
;;;###autoload ;;;###autoload
(defun +evil/paste-preserve-register () (defun +evil/alt-paste ()
"Call `evil-paste-after' without overwriting the clipboard (by writing to the "Call `evil-paste-after' but invert `evil-kill-on-visual-paste'.
0 register instead). This allows you to paste the same text again afterwards." By default, this replaces the selection with what's in the clipboard without
replacing its contents."
(interactive) (interactive)
(let ((evil-this-register ?0)) (let ((evil-kill-on-visual-paste (not evil-kill-on-visual-paste)))
(call-interactively #'evil-paste-after))) (call-interactively #'evil-paste-after)))
(defun +evil--window-swap (direction) (defun +evil--window-swap (direction)

View file

@ -475,7 +475,7 @@ To change these keys see `+evil-repeat-keys'."
:n "[o" #'+evil/insert-newline-above :n "[o" #'+evil/insert-newline-above
:n "]o" #'+evil/insert-newline-below :n "]o" #'+evil/insert-newline-below
:n "gp" #'+evil/reselect-paste :n "gp" #'+evil/reselect-paste
:v "gp" #'+evil/paste-preserve-register :v "gp" #'+evil/alt-paste
:nv "g@" #'+evil:apply-macro :nv "g@" #'+evil:apply-macro
:nv "gc" #'evilnc-comment-operator :nv "gc" #'evilnc-comment-operator
:nv "gx" #'evil-exchange :nv "gx" #'evil-exchange