summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-09-17 14:16:57 -0700
committerFranck Cuny <franck@fcuny.net>2022-09-17 14:16:57 -0700
commit33d0664685ca8bd9fbb98515c15b004658b216df (patch)
tree6b2afc5a045a25cb12f26d2cb31a1029edf6b953
parentfeat(lang/rust): configure Emacs for rust (diff)
downloademacs.d-33d0664685ca8bd9fbb98515c15b004658b216df.tar.gz
ref(tree-sitter): move the configuration to its own file
Change-Id: I424e4d32e05d6bf21f6abb3cc68cad598af31708
-rw-r--r--emacs/custom/my-prog.el10
-rw-r--r--emacs/custom/my-tree-sitter.el21
-rw-r--r--emacs/init.el1
3 files changed, 22 insertions, 10 deletions
diff --git a/emacs/custom/my-prog.el b/emacs/custom/my-prog.el
index c4865a5..578207c 100644
--- a/emacs/custom/my-prog.el
+++ b/emacs/custom/my-prog.el
@@ -3,16 +3,6 @@
 ;;; Commentary:
 
 ;;; Code:
-
-(require 'tree-sitter)
-(require 'tree-sitter-langs)
-;; enable tree-sitter mode for all supported major modes
-(global-tree-sitter-mode)
-;; the minor mode tree-sitter-hl-mode provides the framework for syntax
-;; highlighting. It overrides the regex-based highlighting provided by
-;; font-lock-mode, using the syntax tree provided by tree-sitter-mode
-(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
-
 (customize-set-variable 'Man-notify-method 'aggressive)
 (customize-set-variable 'Man-fontify-manpage-flag t)
 
diff --git a/emacs/custom/my-tree-sitter.el b/emacs/custom/my-tree-sitter.el
new file mode 100644
index 0000000..d19362e
--- /dev/null
+++ b/emacs/custom/my-tree-sitter.el
@@ -0,0 +1,21 @@
+;;; my-tree-sitter.el --- configure emacs for tree-sitter -*- lexical-binding: t -*-
+;; Author: Franck Cuny <franck@fcuny.net>
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'tree-sitter)
+(require 'tree-sitter-langs)
+
+;; enable tree-sitter mode for all supported major modes
+(global-tree-sitter-mode)
+
+;; the minor mode tree-sitter-hl-mode provides the framework for syntax
+;; highlighting. It overrides the regex-based highlighting provided by
+;; font-lock-mode, using the syntax tree provided by tree-sitter-mode
+(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
+
+(provide 'my-tree-sitter)
+
+;;; my-tree-sitter.el ends here
diff --git a/emacs/init.el b/emacs/init.el
index 0a4b12a..910bae5 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -49,6 +49,7 @@
 (require 'my-tramp)
 (require 'my-elfeed)
 
+(require 'my-tree-sitter)
 (require 'my-lsp)
 (require 'my-lang-go)
 (require 'my-lang-python)