From 3e11c7404d3727e178d881775ae027ef6a482d98 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 28 Oct 2015 17:26:18 -0400 Subject: [PATCH] Add evil-ex-define-cmd-local (buffer-local) --- core/core-evil.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/core-evil.el b/core/core-evil.el index 761fafcec..f323448fc 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -70,6 +70,13 @@ (defadvice evil-ex-hl-do-update-highlight (around evil-ex-hidden-buffer-ignore-errors activate) (ignore-errors ad-do-it)) + ;; buffer-local ex commands, thanks to: http://emacs.stackexchange.com/questions/13186 + (defun evil-ex-define-cmd-local (cmd function) + "Locally binds the function FUNCTION to the command CMD." + (unless (local-variable-p 'evil-ex-commands) + (setq-local evil-ex-commands (copy-alist evil-ex-commands))) + (evil-ex-define-cmd cmd function)) + ;; Restore vimmish ex-mode keymaps in isearch ;; Hide keystroke display while isearch is active (add-hook! isearch-mode (setq echo-keystrokes 0))