I am trying to define a function that moves to the begin/end of current text-object.
First - I define an operator:
(evil-define-operator evil-forward-text-object (beg end type)
"move to end of text object"
(if (eq type 'block)
(evil-apply-on-block #'evil-forward-text-object beg end nil)
(goto-char end)))
In this case I need to press M-w i )
to move forward a bracket.
There will be an i
or a
, it is troublesome to type a
or i
,
and there is no difference between i
and a
.
Next - I try to set the keymap:
(define-key evil-motion-state-map (kbd "M-w")
evil-inner-text-objects-map)
This works in some cases, such as M-w p
or M-w o
(forward a kebab-style Lisp symbol).
But in most cases it does not work - for example, M-w )
and M-w "
.
How can I define a command such as I described?