Add whole-buffer (g) and defun (f) text objects
This commit is contained in:
parent
187c9857c4
commit
f2b77fe2c0
2 changed files with 15 additions and 0 deletions
|
@ -170,6 +170,8 @@
|
|||
:textobj "a" #'evil-inner-arg #'evil-outer-arg
|
||||
:textobj "B" #'evil-textobj-anyblock-inner-block #'evil-textobj-anyblock-a-block
|
||||
:textobj "c" #'evilnc-inner-comment #'evilnc-outer-commenter
|
||||
:textobj "f" #'+evil:defun-txtobj #'+evil:defun-txtobj
|
||||
:textobj "g" #'+evil:whole-buffer-txtobj #'+evil:whole-buffer-txtobj
|
||||
:textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent
|
||||
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
|
||||
:textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down
|
||||
|
|
13
modules/editor/evil/autoload/textobjects.el
Normal file
13
modules/editor/evil/autoload/textobjects.el
Normal file
|
@ -0,0 +1,13 @@
|
|||
;;; editor/evil/autoload/textobjects.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload (autoload '+evil:whole-buffer "editor/evil/autoload/textobjects" nil nil)
|
||||
(evil-define-text-object +evil:whole-buffer-txtobj (_count &optional _beg _end type)
|
||||
"Text object to select the whole buffer."
|
||||
(evil-range (point-min) (point-max) type))
|
||||
|
||||
;;;###autoload (autoload '+evil:defun-txtobj "editor/evil/autoload/textobjects" nil nil)
|
||||
(evil-define-text-object +evil:defun-txtobj (_count &optional _beg _end type)
|
||||
"Text object to select the whole buffer."
|
||||
(cl-destructuring-bind (beg . end)
|
||||
(bounds-of-thing-at-point 'defun)
|
||||
(evil-range beg end type)))
|
Loading…
Add table
Add a link
Reference in a new issue