Add ex-local! + define local org ex commands
This commit is contained in:
parent
4057c56e4c
commit
002704d6bb
2 changed files with 13 additions and 3 deletions
|
@ -190,6 +190,14 @@ Examples:
|
||||||
(after! evil
|
(after! evil
|
||||||
(defalias 'ex! 'evil-ex-define-cmd)
|
(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!')
|
;; Register keywords for proper indentation (see `map!')
|
||||||
(put ':prefix 'lisp-indent-function 'defun)
|
(put ':prefix 'lisp-indent-function 'defun)
|
||||||
(put ':map 'lisp-indent-function 'defun)
|
(put ':map 'lisp-indent-function 'defun)
|
||||||
|
|
|
@ -98,9 +98,11 @@
|
||||||
(ex! "tabs" 'doom/tab-display)
|
(ex! "tabs" 'doom/tab-display)
|
||||||
|
|
||||||
;; Org-mode
|
;; Org-mode
|
||||||
(ex! "att[ach]" 'doom:org-attach) ; attach file to org file
|
(add-hook! org-mode
|
||||||
(ex! "link" 'doom:org-link)
|
;;(ex! "org" 'doom:org-helm-search) ; search org notes
|
||||||
(ex! "org" 'doom:org-helm-search) ; search org notes
|
(ex! "att[ach]" 'doom:org-attach) ; attach file to org file
|
||||||
|
(ex! "link" 'doom:org-link)
|
||||||
|
(ex-local! "vlc" 'doom-org-insert-vlc))
|
||||||
|
|
||||||
(provide 'my-commands)
|
(provide 'my-commands)
|
||||||
;;; my-commands.el ends here
|
;;; my-commands.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue