mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Add whole-buffer (g) and defun (f) text objects
This commit is contained in:
@ -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)))
|
Reference in New Issue
Block a user