summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-10-23 17:30:41 -0400
committerJack Jamison <jackqjamison@gmail.com>2025-10-23 17:30:41 -0400
commit4cb8b4a83712cc65ae9a826b7719530c1ece52b2 (patch)
tree51c032752148d534406ffa9134fabf8a9e8a5ea8
parent5ee425fc48ca3347c23cc3b25108712bf8696e91 (diff)
in line evil text object
-rw-r--r--.config/emacs/TODO.org4
-rw-r--r--.config/emacs/init.el15
2 files changed, 16 insertions, 3 deletions
diff --git a/.config/emacs/TODO.org b/.config/emacs/TODO.org
index ce81048..3cecd63 100644
--- a/.config/emacs/TODO.org
+++ b/.config/emacs/TODO.org
@@ -1,3 +1 @@
-- [ ] Fix completion issues
-- [ ] Fix freeze
-- [ ] Fix error messages on the side
+- [ ] connect xdg open to current session
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 0799189..015855c 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -189,6 +189,21 @@
(define-key evil-window-map (kbd "C-g") #'evil-keyboard-quit)
(define-key evil-operator-state-map (kbd "C-g") #'evil-keyboard-quit))
+;; Custom "in-line" text object
+(evil-define-text-object evil-inner-line (count &optional beg end type)
+ "Select the current line excluding leading/trailing whitespace."
+ (let* ((line-start (line-beginning-position))
+ (line-end (line-end-position))
+ (text (buffer-substring-no-properties line-start line-end))
+ (nonspace-start (string-match-p "\\S-" text))
+ (nonspace-end (or (save-match-data
+ (string-match-p "\\S-\\s-*\\'" text))
+ 0)))
+ (evil-range (+ line-start nonspace-start)
+ (+ line-start nonspace-end)
+ 'exclusive)))
+(define-key evil-inner-text-objects-map "l" 'evil-inner-line)
+
;; == style
;; theme
;; (use-package dracula-theme