Commit c34dc52fc889

Vincent Demeester <vincent@sbr.pm>
2025-10-29 17:10:24
tools/emacs: configure treesit-fold
I think I will need to add more parsers, but it is a start. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent c6da275
Changed files (1)
tools
emacs
tools/emacs/init.el
@@ -373,6 +373,15 @@ minibuffer, even without explicitly focusing it."
   :hook
   (prog-mode . flymake-mode))
 
+(use-package treesit-fold
+  :hook
+  (after-init . global-treesit-fold-mode)
+  :config
+  (setq treesit-fold-line-count-show t)  ; Show line count in folded regions
+  (setq treesit-fold-line-count-format " <%d lines> ")
+  (global-set-key (kbd "C-c f f") 'treesit-fold-close)
+  (global-set-key (kbd "C-c f o") 'treesit-fold-open))
+
 (use-package aggressive-indent
   :commands (aggressive-indent-mode)
   :hook