Add q text-object for all quotes
This commit is contained in:
parent
f33b141650
commit
164b997cb0
3 changed files with 23 additions and 0 deletions
|
@ -106,6 +106,8 @@ And these are text objects added by this module:
|
||||||
+ =g= The entire buffer
|
+ =g= The entire buffer
|
||||||
+ =i j k= by indentation (=k= includes one line above; =j= includes one line
|
+ =i j k= by indentation (=k= includes one line above; =j= includes one line
|
||||||
above and below) (provided by ~evil-indent-plus~)
|
above and below) (provided by ~evil-indent-plus~)
|
||||||
|
+ =q= For quotes (any kind)
|
||||||
|
+ =u= For URLs
|
||||||
+ =x= XML attributes (provided by ~exato~)
|
+ =x= XML attributes (provided by ~exato~)
|
||||||
|
|
||||||
** Custom Ex Commands
|
** Custom Ex Commands
|
||||||
|
|
|
@ -42,3 +42,23 @@ This excludes the protocol and querystring."
|
||||||
(evil-range
|
(evil-range
|
||||||
beg (- end (if (evil-visual-state-p) 1 0))
|
beg (- end (if (evil-visual-state-p) 1 0))
|
||||||
type)))
|
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)))
|
||||||
|
|
|
@ -541,6 +541,7 @@ directives. By default, this only recognizes C directives.")
|
||||||
:textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent
|
:textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent
|
||||||
:textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down
|
:textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down
|
||||||
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
|
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
|
||||||
|
:textobj "q" #'+evil:inner-any-quote #'+evil:outer-any-quote
|
||||||
:textobj "u" #'+evil:inner-url-txtobj #'+evil:outer-url-txtobj
|
:textobj "u" #'+evil:inner-url-txtobj #'+evil:outer-url-txtobj
|
||||||
:textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr
|
:textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue