From 6baf30050f5cb921b49aaa4bad6e31456aaeb03f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 26 Feb 2021 23:30:55 -0600 Subject: Shell indentation and stuff --- config.org | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'config.org') diff --git a/config.org b/config.org index 68f1b4e..3c6d2cb 100644 --- a/config.org +++ b/config.org @@ -1525,7 +1525,9 @@ makes that harder than it should be, but let's start at the basics. #+begin_src emacs-lisp :noweb-ref settings (setq-default indent-tabs-mode t - tab-width 8) + tab-width 8 + ;; smie is a common indentation thing for a lot of other modes. + smie-indent-basic 8) #+end_src **** Smart tabs :package: @@ -2100,7 +2102,7 @@ installed. *** Shell scripts -**** Shellcheck +**** Shellcheck :package: #+begin_src emacs-lisp :noweb-ref packages (straight-use-package 'flymake-shellcheck) @@ -2113,6 +2115,8 @@ installed. **** Formatting +***** =shfmt= :package: + #+begin_src emacs-lisp :noweb-ref modes (when (executable-find "shfmt") (reformatter-define sh-format @@ -2123,9 +2127,14 @@ installed. (add-hook 'sh-mode-hook #'sh-format-on-save-mode)) #+end_src +***** =sh-mode= indenting + +I'm trying to make this match what =shfmt= does as much as I can, to avoid the +reformatting when saving. + #+begin_src emacs-lisp :noweb-ref settings (setq-default sh-basic-offset 8 - smie-indent-basic 8) + sh-indent-after-case 0) #+end_src * Applications -- cgit 1.4.1-21-gabe81