evil-multiedit: simplify keybinding setup

This commit is contained in:
Henrik Lissner 2016-06-04 23:27:53 -04:00
parent 805e1fa8ff
commit a7d97a2f42
4 changed files with 14 additions and 22 deletions

View file

@ -58,11 +58,6 @@ during compilation."
'with-no-warnings) 'with-no-warnings)
(with-eval-after-load ',feature ,@forms))) (with-eval-after-load ',feature ,@forms)))
(defmacro in! (dir &rest forms)
(declare (indent defun))
`(let ((default-directory ,dir))
,@forms))
(defmacro noop! (name &optional args) (defmacro noop! (name &optional args)
`(defun ,name ,args (interactive) (error "%s not implemented!" name))) `(defun ,name ,args (interactive) (error "%s not implemented!" name)))

View file

@ -227,19 +227,14 @@
:commands (evil-multiedit-match-all :commands (evil-multiedit-match-all
evil-multiedit-match-and-next evil-multiedit-match-and-next
evil-multiedit-match-and-prev evil-multiedit-match-and-prev
evil-multiedit-match-symbol-and-next
evil-multiedit-match-symbol-and-prev
evil-multiedit-toggle-or-restrict-region evil-multiedit-toggle-or-restrict-region
evil-multiedit-next evil-multiedit-next
evil-multiedit-prev evil-multiedit-prev
evil-multiedit-abort evil-multiedit-abort
evil-multiedit-ex-match) evil-multiedit-ex-match)
:config :config (evil-multiedit-default-keybinds))
(map! :map evil-multiedit-state-map
"RET" 'evil-multiedit-toggle-or-restrict-region
"C-n" 'evil-multiedit-next
"C-p" 'evil-multiedit-prev
:map evil-multiedit-insert-state-map
"C-n" 'evil-multiedit-next
"C-p" 'evil-multiedit-prev))
(use-package evil-indent-plus (use-package evil-indent-plus
:commands (evil-indent-plus-i-indent :commands (evil-indent-plus-i-indent

View file

@ -12,7 +12,7 @@
(setq shackle-rules (setq shackle-rules
`(;; Util `(;; Util
("^\\*.+-Profiler-Report .+\\*$" :align below :size 0.3 :regexp t) ("^\\*.+-Profiler-Report .+\\*$" :align below :size 0.3 :regexp t)
("*esup*" :align below :size 0.4 :noselect t) ("*esup*" :align below :size 0.4 :noselect t)
("*minor-modes*" :align below :size 0.5 :noselect t) ("*minor-modes*" :align below :size 0.5 :noselect t)
("*eval*" :align below :size 20) ("*eval*" :align below :size 20)
;; Emacs ;; Emacs
@ -77,6 +77,8 @@
(switch-to-buffer b)))) (switch-to-buffer b))))
(after! evil (after! evil
;; The evil command window has a mind of its own (uses `switch-to-buffer'). We
;; monkey patch it to use pop-to-buffer.
(defun doom*evil-command-window (hist cmd-key execute-fn) (defun doom*evil-command-window (hist cmd-key execute-fn)
(when (eq major-mode 'evil-command-window-mode) (when (eq major-mode 'evil-command-window-mode)
(user-error "Cannot recursively open command line window")) (user-error "Cannot recursively open command line window"))
@ -96,10 +98,10 @@
(advice-add 'evil-command-window :override 'doom*evil-command-window)) (advice-add 'evil-command-window :override 'doom*evil-command-window))
(after! help-mode (after! help-mode
;; So that file links in help buffers don't replace the help buffer, we need ;; Following links in help buffers sometimes uses itself or other-window. We
;; to redefine these three button types to use `doom/popup-save' and ;; want it only to replace the buffer we opened the popup from. To do this we
;; `switch-to-buffer' rather than `pop-to-buffer'. This way, it is sure to ;; must redefine these three button types to use `doom/popup-save' and
;; open links in the source buffer. ;; `switch-to-buffer' rather than `pop-to-buffer'.
(define-button-type 'help-function-def (define-button-type 'help-function-def
:supertype 'help-xref :supertype 'help-xref
'help-function (lambda (fun file) 'help-function (lambda (fun file)

View file

@ -236,10 +236,10 @@
;; evil-multiedit ;; evil-multiedit
:v "R" 'evil-multiedit-match-all :v "R" 'evil-multiedit-match-all
:n "M-C-D" 'evil-multiedit-restore :n "M-C-D" 'evil-multiedit-restore
:nv "M-d" 'evil-multiedit-match-and-next :n "M-d" 'evil-multiedit-match-symbol-and-next
:nv "M-D" 'evil-multiedit-match-and-prev :n "M-D" 'evil-multiedit-match-symbol-and-prev
(:map evil-multiedit-state-map :v "M-d" 'evil-multiedit-match-and-next
:v "RET" 'evil-multiedit-toggle-or-restrict-region) :v "M-D" 'evil-multiedit-match-and-prev
;; evil-surround ;; evil-surround
:v "S" 'evil-surround-region :v "S" 'evil-surround-region