config/default: add +default-repeat-{forward,backward}-key options
This commit is contained in:
parent
e41212bb7b
commit
1983363f9c
1 changed files with 5 additions and 2 deletions
|
@ -74,14 +74,17 @@
|
||||||
(load! +evil-commands))
|
(load! +evil-commands))
|
||||||
|
|
||||||
(when (featurep! +bindings)
|
(when (featurep! +bindings)
|
||||||
|
(defvar +default-repeat-forward-key ";")
|
||||||
|
(defvar +default-repeat-backward-key ",")
|
||||||
|
|
||||||
;; Makes ; and , the universal repeat-keys in evil-mode
|
;; Makes ; and , the universal repeat-keys in evil-mode
|
||||||
(defmacro do-repeat! (command next-func prev-func)
|
(defmacro do-repeat! (command next-func prev-func)
|
||||||
"Repeat motions with ;/,"
|
"Repeat motions with ;/,"
|
||||||
(let ((fn-sym (intern (format "+evil*repeat-%s" command))))
|
(let ((fn-sym (intern (format "+evil*repeat-%s" command))))
|
||||||
`(progn
|
`(progn
|
||||||
(defun ,fn-sym (&rest _)
|
(defun ,fn-sym (&rest _)
|
||||||
(define-key evil-motion-state-map ";" ',next-func)
|
(define-key evil-motion-state-map +default-repeat-forward-key ',next-func)
|
||||||
(define-key evil-motion-state-map "," ',prev-func))
|
(define-key evil-motion-state-map +default-repeat-backward-key ',prev-func))
|
||||||
(advice-add #',command :before #',fn-sym))))
|
(advice-add #',command :before #',fn-sym))))
|
||||||
|
|
||||||
;; n/N
|
;; n/N
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue