Directly map gr to eval-buffer/region
This commit is contained in:
parent
5b911359e5
commit
5c1aac9178
1 changed files with 9 additions and 3 deletions
|
@ -10,9 +10,13 @@
|
||||||
|
|
||||||
(add-hook 'after-save-hook 'remove-elc-on-save)
|
(add-hook 'after-save-hook 'remove-elc-on-save)
|
||||||
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
||||||
(add-hook! 'emacs-lisp-mode-hook
|
|
||||||
(setq my-run-code-func 'eval-buffer
|
(evil-define-operator my:elisp-eval (beg end)
|
||||||
my-run-code-region-func 'eval-region))
|
:move-point nil
|
||||||
|
(interactive "<r>")
|
||||||
|
(cond ((and beg end)
|
||||||
|
(eval-region beg end))
|
||||||
|
(t (eval-buffer))))
|
||||||
|
|
||||||
;; Real go-to-definition for elisp
|
;; Real go-to-definition for elisp
|
||||||
(bind 'motion emacs-lisp-mode-map "gd"
|
(bind 'motion emacs-lisp-mode-map "gd"
|
||||||
|
@ -23,3 +27,5 @@
|
||||||
(bind 'motion emacs-lisp-mode-map "gD"
|
(bind 'motion emacs-lisp-mode-map "gD"
|
||||||
(λ (let ((func (function-called-at-point)))
|
(λ (let ((func (function-called-at-point)))
|
||||||
(if func (find-function-other-window func)))))
|
(if func (find-function-other-window func)))))
|
||||||
|
|
||||||
|
(bind 'motion emacs-lisp-mode-map "g r" 'my:elisp-eval)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue