From 8f388410820cb19d5d85f51ad191acd98b880592 Mon Sep 17 00:00:00 2001 From: person808 Date: Wed, 29 Apr 2015 06:49:45 -1000 Subject: [PATCH] Make evil-smart* functions respect leader key. --- spacemacs/packages.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 78a111487..7a59832a1 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -677,22 +677,25 @@ Example: (evil-map visual \"<\" \"" ">gv") - (defun spacemacs/smart-doc-lookup () - "Bind K to SPC m h h and fall back to `evil-lookup'" + (defun spacemacs/evil-smart-doc-lookup () + "Version of `evil-lookup' that attempts to use + the mode specific goto-definition binding, + i.e. `SPC m h h`, to lookup the source of the definition, + while falling back to `evil-lookup'" (interactive) (condition-case nil - (execute-kbd-macro (kbd "SPC m h h")) + (execute-kbd-macro (kbd (concat dotspacemacs-leader-key " m h h"))) (error (evil-lookup)))) - (define-key evil-normal-state-map (kbd "K") 'spacemacs/smart-doc-lookup) + (define-key evil-normal-state-map (kbd "K") 'spacemacs/evil-smart-doc-lookup) (defun spacemacs/evil-smart-goto-definition () "Version of `evil-goto-definition' that attempts to use the mode specific goto-definition binding, i.e. `SPC m g g`, to lookup the source of the definition, - while falling back to `evil-goto-definition'." + while falling back to `evil-goto-definition'" (interactive) (condition-case nil - (execute-kbd-macro (kbd "SPC m g g")) + (execute-kbd-macro (kbd (concat dotspacemacs-leader-key "m g g"))) (error (evil-goto-definition)))) (define-key evil-normal-state-map (kbd "gd") 'spacemacs/evil-smart-goto-definition)