Skip to content

Commit

Permalink
emacs: Use tree-sitter for bash
Browse files Browse the repository at this point in the history
  • Loading branch information
tlater-famedly committed Jul 28, 2024
1 parent 15e24c7 commit 266e74c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion home-config/dotfiles/emacs.d/config/editing.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@

(leaf files
:ensure nil
:custom (require-final-newline . "visit-save"))
:custom (require-final-newline . "visit-save")
:custom (major-mode-remap-alist . '((sh-mode . bash-ts-mode))))

;; ----------------------------------------------------------------------------------
;;; Snippets
Expand Down
6 changes: 3 additions & 3 deletions home-config/dotfiles/emacs.d/config/programming-languages.el
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@

(leaf flymake-shellcheck
:commands flymake-shellcheck-load
:hook (sh-mode-hook . flymake-shellcheck-load)
:hook (sh-mode-hook . (lambda () (setq-local devdocs-current-docs '("bash")))))
:hook ((sh-mode-hook bash-ts-mode-hook) . flymake-shellcheck-load)
:hook ((sh-mode-hook bash-ts-mode-hook) . (lambda () (setq-local devdocs-current-docs '("bash")))))

;; ----------------------------------------------------------------------------------
;;; Systemd
Expand Down Expand Up @@ -307,7 +307,7 @@
(leaf eglot
:commands (eglot eglot-format eglot-managed-p)
:hook (((kotlin-mode-hook web-mode-hook rust-mode-hook python-mode-hook
sh-mode-hook c-mode-hook c++-mode-hook nix-mode-hook json-mode-hook) .
sh-mode-hook bash-ts-mode-hook c-mode-hook c++-mode-hook nix-mode-hook json-mode-hook) .
eglot-ensure)
(eglot-managed-mode-hook . set-eldoc-compose))
:bind (:eglot-mode-map
Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ let
custom-emacs = emacsPkgs.emacs.pkgs.withPackages (
epkgs: (map (package: builtins.getAttr package epkgs) required-packages) ++ [
(epkgs.treesit-grammars.with-grammars (grammars: with grammars; [
tree-sitter-bash
tree-sitter-typescript
tree-sitter-tsx
]))
Expand Down

0 comments on commit 266e74c

Please sign in to comment.