Add evil-ex-define-cmd-local (buffer-local)

This commit is contained in:
Henrik Lissner 2015-10-28 17:26:18 -04:00
parent ec075e03b2
commit 3e11c7404d

View file

@ -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))