config/default: add & bind +evil/paste-preserve-register (gp)

This commit is contained in:
Henrik Lissner 2018-05-07 18:16:46 +02:00
parent e22c176195
commit 7c1bb8f658
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395
2 changed files with 9 additions and 0 deletions

View File

@ -326,6 +326,7 @@
:m "gd" #'+lookup/definition
:m "gD" #'+lookup/references
:n "gp" #'+evil/reselect-paste
:v "gp" #'+evil/paste-preserve-register
:n "gr" #'+eval:region
:n "gR" #'+eval/buffer
:v "gR" #'+eval:replace-region

View File

@ -27,6 +27,14 @@
(save-excursion (goto-char beg) (point-marker))
end)))
;;;###autoload
(defun +evil/paste-preserve-register ()
"Call `evil-paste-after' without overwriting the clipboard (by writing to the
0 register instead). This allows you to paste the same text again afterwards."
(interactive)
(let ((evil-this-register ?0))
(call-interactively #'evil-paste-after)))
(defun +evil--window-swap (direction)
"Move current window to the next window in DIRECTION. If there are no windows
there and there is only one window, split in that direction and place this