Add whole-buffer (g) and defun (f) text objects

This commit is contained in:
Henrik Lissner 2019-10-26 00:37:12 -04:00
parent 187c9857c4
commit f2b77fe2c0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 15 additions and 0 deletions

View 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)))