feat(evil): di| ci| vi| text objects for org table cells
This commit is contained in:
29
config.el
29
config.el
@@ -1532,6 +1532,35 @@ current frame."
|
|||||||
:desc "Copy git link commit" "Y" #'git-link-commit))
|
:desc "Copy git link commit" "Y" #'git-link-commit))
|
||||||
|
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; EVIL — ORG TABLE CELL TEXT OBJECTS (di| ci| vi|)
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
;; org-table text objects: "|" = cell (di|, ci|, vi|)
|
||||||
|
(after! evil-org
|
||||||
|
;; Activate all key themes including textobjects
|
||||||
|
(evil-org-set-key-theme '(navigation insert textobjects additional calendar))
|
||||||
|
|
||||||
|
;; Define inner table cell text object
|
||||||
|
(evil-define-text-object evil-org-inner-table-cell (count &optional beg end type)
|
||||||
|
"Inner org table cell (content between pipes)."
|
||||||
|
(when (org-at-table-p)
|
||||||
|
(let ((b (save-excursion
|
||||||
|
(search-backward "|")
|
||||||
|
(forward-char 1)
|
||||||
|
(skip-chars-forward " ")
|
||||||
|
(point)))
|
||||||
|
(e (save-excursion
|
||||||
|
(search-forward "|")
|
||||||
|
(backward-char 1)
|
||||||
|
(skip-chars-backward " ")
|
||||||
|
(point))))
|
||||||
|
(list b e))))
|
||||||
|
|
||||||
|
(define-key evil-inner-text-objects-map "|" #'evil-org-inner-table-cell)
|
||||||
|
(define-key evil-outer-text-objects-map "|" #'evil-org-inner-table-cell))
|
||||||
|
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; FORGE — Gitea integration
|
;;; FORGE — Gitea integration
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user