Add :g switch to map! #249
This commit is contained in:
parent
9a959e73bc
commit
19ca683f86
1 changed files with 15 additions and 7 deletions
|
@ -17,7 +17,8 @@
|
|||
(?e . emacs)
|
||||
(?o . operator)
|
||||
(?m . motion)
|
||||
(?r . replace))
|
||||
(?r . replace)
|
||||
(?g . global))
|
||||
"A list of cons cells that map a letter to a evil state symbol.")
|
||||
|
||||
|
||||
|
@ -267,16 +268,23 @@ Example
|
|||
forms)
|
||||
(throw 'skip 'local))
|
||||
((and doom--keymaps states)
|
||||
(unless (featurep 'evil) (throw 'skip 'evil))
|
||||
(unless (featurep 'evil)
|
||||
(throw 'skip 'evil))
|
||||
(dolist (keymap doom--keymaps)
|
||||
(when (memq 'global states)
|
||||
(push `(define-key ,keymap ,key ,def) forms))
|
||||
(when-let (states (delq 'global states))
|
||||
(push `(,(if doom--defer 'evil-define-key 'evil-define-key*)
|
||||
',states ,keymap ,key ,def)
|
||||
forms)))
|
||||
forms))))
|
||||
(states
|
||||
(unless (featurep 'evil) (throw 'skip 'evil))
|
||||
(unless (featurep 'evil)
|
||||
(throw 'skip 'evil))
|
||||
(dolist (state states)
|
||||
(push `(define-key
|
||||
,(intern (format "evil-%s-state-%smap" state (if doom--local "local-" "")))
|
||||
,(if (eq state 'global)
|
||||
'(current-global-map)
|
||||
(intern (format "evil-%s-state-%smap" state (if doom--local "local-" ""))))
|
||||
,key ,def)
|
||||
forms)))
|
||||
(doom--keymaps
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue