feat(fold): add treesit-fold support

This commit is contained in:
Henrik Lissner
2025-05-07 18:14:52 -04:00
parent 1ac1b70d4e
commit f2678b3ea2
3 changed files with 47 additions and 48 deletions

View File

@@ -3,8 +3,7 @@
(defcustom +fold-ellipsis " [...] "
"The ellipsis to show for ellided regions (folds).
`org-ellipsis', `truncate-string-ellipsis', and `ts-fold-replacement' are set to
this."
`org-ellipsis' and `truncate-string-ellipsis' are set to this."
:type 'string
:group '+fold)
@@ -106,9 +105,8 @@ this."
(vimish-fold-global-mode +1))
(use-package! ts-fold
:when (modulep! :tools tree-sitter)
:after tree-sitter
:config
(setq ts-fold-replacement +fold-ellipsis)
(global-ts-fold-mode +1))
;; Will be autoloaded by fold commands
(use-package! treesit-fold
:when (modulep! :tools tree-sitter -compat)
:defer t
:config (global-treesit-fold-mode +1))