Skip to content

Commit

Permalink
feat(modules/emacs): Install more grammars for tree sitter
Browse files Browse the repository at this point in the history
  • Loading branch information
etu committed Sep 28, 2023
1 parent 5da05a0 commit 89b8a0b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions modules/base/emacs/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -563,14 +563,13 @@
;;;
;;; Tree sitter
;;;
(use-package nix-ts-mode :ensure t)

(add-to-list 'treesit-extra-load-path "@treesitGrammars@/lib")

(setq major-mode-remap-alist
'((sh-mode . bash-ts-mode)
(css-mode . css-ts-mode)
(dockerfile-mode . dockerfile-ts-mode)
(conf-toml-mode . toml-ts-mode)
))

;;;
Expand Down
18 changes: 18 additions & 0 deletions modules/base/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,26 @@
treesitGrammars = emacsPackages.${config.etu.base.emacs.package}.pkgs.treesit-grammars.with-grammars (g:
with g; [
tree-sitter-bash
tree-sitter-c
tree-sitter-cmake
tree-sitter-cpp
tree-sitter-css
tree-sitter-dockerfile
tree-sitter-go
tree-sitter-gomod
tree-sitter-hcl
tree-sitter-html
tree-sitter-java
tree-sitter-json
tree-sitter-latex
tree-sitter-make
tree-sitter-nix
tree-sitter-php
tree-sitter-python
tree-sitter-rust
tree-sitter-sql
tree-sitter-toml
tree-sitter-yaml
]);

# Function to wrap emacs to contain the path for language servers
Expand Down

0 comments on commit 89b8a0b

Please sign in to comment.