Add :g switch to map! #249

This commit is contained in:
Henrik Lissner 2017-10-25 14:50:02 +02:00
parent 9a959e73bc
commit 19ca683f86
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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)
(push `(,(if doom--defer 'evil-define-key 'evil-define-key*)
',states ,keymap ,key ,def)
forms)))
(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))))
(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