mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add :textobj keyword to map!
This commit is contained in:
@ -77,6 +77,7 @@ For example, :nvi will map to (list 'normal 'visual 'insert). See
|
||||
(put ':desc 'lisp-indent-function 'defun)
|
||||
(put ':leader 'lisp-indent-function 'defun)
|
||||
(put ':localleader 'lisp-indent-function 'defun)
|
||||
(put ':textobj 'lisp-indent-function 'defun)
|
||||
|
||||
(defmacro map! (&rest rest)
|
||||
"A nightmare of a key-binding macro that will use `evil-define-key*',
|
||||
@ -106,6 +107,9 @@ States
|
||||
|
||||
:L cannot be in a :map.
|
||||
|
||||
:textobj is a special state that takes a key and two commands, one for the
|
||||
inner binding, another for the outer.
|
||||
|
||||
Flags
|
||||
(:mode [MODE(s)] [...]) ; inner keybinds are applied to major MODE(s)
|
||||
(:map [KEYMAP(s)] [...]) ; inner keybinds are applied to KEYMAP(S)
|
||||
@ -165,6 +169,13 @@ Example
|
||||
(setq keymaps
|
||||
(mapcar (lambda (m) (intern (format "%s-map" (symbol-name m))))
|
||||
modes))))
|
||||
(:textobj
|
||||
(let* ((key (pop rest))
|
||||
(inner (pop rest))
|
||||
(outer (pop rest)))
|
||||
(push (macroexpand `(map! (:map evil-outer-text-objects-map ,key ,inner)
|
||||
(:map evil-inner-text-objects-map ,key ,outer)))
|
||||
forms)))
|
||||
(:prefix
|
||||
(let ((def (pop rest)))
|
||||
(setq prefix
|
||||
|
Reference in New Issue
Block a user