From ec7c111e2fa8687a398c2dcfbd5929afe1bd8839 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Sun, 21 Nov 2021 16:26:25 +0000 Subject: [PATCH] feat(emacs): update sh-mode This adds shellcheck for creating better scripts and bats mode for testing support. It also added .env files to the mode list so I get highlighting in .env files --- site-modules/core/files/emacs/src/lang/shell.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/site-modules/core/files/emacs/src/lang/shell.el b/site-modules/core/files/emacs/src/lang/shell.el index 350b43a..1dcede8 100644 --- a/site-modules/core/files/emacs/src/lang/shell.el +++ b/site-modules/core/files/emacs/src/lang/shell.el @@ -8,3 +8,14 @@ ;; sh-mode is already installed just need to enable lsp in that mode (add-hook 'sh-mode-hook 'lsp) + +;; Add .env file to be highlighted with the sh-mode syntax +(add-to-list 'auto-mode-alist '("\\.env\\'" . sh-mode)) +(add-to-list 'auto-mode-alist '("\\.env\\.example\\'" . sh-mode)) + +(use-package flymake-shellcheck + :commands flymake-shellcheck-load + :init + (add-hook 'sh-mode-hook 'flymake-shellcheck-load)) + +(use-package bats-mode :ensure t);