Skip to content

Commit

Permalink
Add treesit-fold
Browse files Browse the repository at this point in the history
  • Loading branch information
chuxubank committed May 22, 2024
1 parent cc2c2d6 commit ac7cea5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
15 changes: 0 additions & 15 deletions cats/+tree-sitter.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
;; -*- lexical-binding: t; -*-

;; https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide?h=feature/tree-sitter

(setq treesit-font-lock-level 4)

(use-package tree-sitter
:delight ""
:hook
Expand Down Expand Up @@ -41,14 +37,3 @@ more information."
(push '(import_declaration
. (lambda (node offset)
(ts-fold-range-same node offset "import "))) (alist-get 'java-mode ts-fold-range-alist)))

(use-package treesit-auto
:disabled
:when EMACS29+
:hook (after-init . global-treesit-auto-mode)
:custom
(treesit-auto-install 'prompt)
:config
(dolist (lang '(cmake cpp bash))
(setq treesit-auto-langs (delete lang treesit-auto-langs)))
(setq treesit-language-source-alist (treesit-auto--build-treesit-source-alist)))
21 changes: 21 additions & 0 deletions cats/+treesit.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
;; -*- lexical-binding: t; -*-

;; https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide?h=feature/tree-sitter

(use-package treesit
:ensure nil
:custom
(treesit-font-lock-level 4))

(use-package treesit-fold
:hook (after-init . global-treesit-fold-mode)
:pin jcs-elpa)

(use-package treesit-auto
:hook (after-init . global-treesit-auto-mode)
:custom
(treesit-auto-install 'prompt)
:config
(dolist (lang '(cmake cpp bash))
(setq treesit-auto-langs (delete lang treesit-auto-langs)))
(setq treesit-language-source-alist (treesit-auto--build-treesit-source-alist)))
2 changes: 1 addition & 1 deletion config.el
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
;;; code
(cat! "+format")
(cat! "+flycheck")
(cat! "+tree-sitter")
(if EMACS29+ (cat! "+treesit") (cat! "+tree-sitter"))
(cat! "+doc")
(cat! "+sideline")
(cat! "+codeium")
Expand Down

0 comments on commit ac7cea5

Please sign in to comment.