Add ex-local! + define local org ex commands

This commit is contained in:
Henrik Lissner 2016-06-08 03:50:20 -04:00
parent 4057c56e4c
commit 002704d6bb
2 changed files with 13 additions and 3 deletions

View file

@ -190,6 +190,14 @@ Examples:
(after! evil
(defalias 'ex! 'evil-ex-define-cmd)
;; NOTE evil-mode doesn't read local `evil-ex-commands', and will
;; not autocomplete local commands.
(defun ex-local! (cmd fn)
"Define a buffer-local ex command."
(unless (local-variable-p 'evil-ex-commands)
(setq-local evil-ex-commands (copy-alist evil-ex-commands)))
(evil-ex-define-cmd cmd fn))
;; Register keywords for proper indentation (see `map!')
(put ':prefix 'lisp-indent-function 'defun)
(put ':map 'lisp-indent-function 'defun)