From d46c2582d0d0c870878834bc28d442dc16390f66 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 Feb 2019 00:51:07 -0500 Subject: [PATCH] Fix 'not an evil-paste' error on SPC i y #1095 yank-pop and evil-paste-pop are picky little buggers, we need our own delegate. --- modules/config/default/+evil-bindings.el | 2 +- modules/config/default/autoload/default.el | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 93ee54acc..5f8fb166c 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -662,7 +662,7 @@ :desc "Man pages" "w" #'+default/man-or-woman) (:prefix ("i" . "insert") - :desc "Insert from clipboard" "y" #'yank-pop + :desc "Insert from clipboard" "y" #'+default/yank-pop :desc "Insert from evil register" "r" #'evil-ex-registers :desc "Insert snippet" "s" #'yas-insert-snippet) diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index 1479e70a4..7f46bf68c 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -110,3 +110,12 @@ If ARG (universal argument), runs `compile' from the current directory." (call-interactively 'evil-open-below) (end-of-line) (newline-and-indent))) + +;;;###autoload +(defun +default/yank-pop () + "Interactively select what text to insert from the kill ring." + (interactive) + (call-interactively + (cond ((fboundp 'counsel-yank-pop) #'counsel-yank-pop) + ((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring) + ((error "No kill-ring search backend available. Enable ivy or helm!")))))