Add q text-object for all quotes

This commit is contained in:
Henrik Lissner 2020-10-27 23:18:06 -04:00
parent f33b141650
commit 164b997cb0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 23 additions and 0 deletions

View file

@ -42,3 +42,23 @@ This excludes the protocol and querystring."
(evil-range
beg (- end (if (evil-visual-state-p) 1 0))
type)))
;;;###autoload (autoload '+evil:inner-any-quote "editor/evil/autoload/textobjects" nil nil)
(evil-define-text-object +evil:inner-any-quote (count &optional beg end type)
"Select the closest inner quote."
(let ((evil-textobj-anyblock-blocks
'(("'" . "'")
("\"" . "\"")
("`" . "`")
("" . ""))))
(evil-textobj-anyblock-inner-block count beg end type)))
;;;###autoload (autoload '+evil:outer-any-quote "editor/evil/autoload/textobjects" nil nil)
(evil-define-text-object +evil:outer-any-quote (count &optional beg end type)
"Select the closest outer quote."
(let ((evil-textobj-anyblock-blocks
'(("'" . "'")
("\"" . "\"")
("`" . "`")
("" . ""))))
(evil-textobj-anyblock-a-block count beg end type)))