about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-02-26 23:30:55 -0600
committerCase Duckworth2021-02-26 23:30:55 -0600
commit6baf30050f5cb921b49aaa4bad6e31456aaeb03f (patch)
tree313a1f266c99767aacbf16c30deea3af84ff2a99
parentMore autoloading stuff (diff)
downloademacs-6baf30050f5cb921b49aaa4bad6e31456aaeb03f.tar.gz
emacs-6baf30050f5cb921b49aaa4bad6e31456aaeb03f.zip
Shell indentation and stuff
-rw-r--r--config.org15
1 files changed, 12 insertions, 3 deletions
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.
1525 1525
1526#+begin_src emacs-lisp :noweb-ref settings 1526#+begin_src emacs-lisp :noweb-ref settings
1527 (setq-default indent-tabs-mode t 1527 (setq-default indent-tabs-mode t
1528 tab-width 8) 1528 tab-width 8
1529 ;; smie is a common indentation thing for a lot of other modes.
1530 smie-indent-basic 8)
1529#+end_src 1531#+end_src
1530 1532
1531**** Smart tabs :package: 1533**** Smart tabs :package:
@@ -2100,7 +2102,7 @@ installed.
2100 2102
2101*** Shell scripts 2103*** Shell scripts
2102 2104
2103**** Shellcheck 2105**** Shellcheck :package:
2104 2106
2105#+begin_src emacs-lisp :noweb-ref packages 2107#+begin_src emacs-lisp :noweb-ref packages
2106 (straight-use-package 'flymake-shellcheck) 2108 (straight-use-package 'flymake-shellcheck)
@@ -2113,6 +2115,8 @@ installed.
2113 2115
2114**** Formatting 2116**** Formatting
2115 2117
2118***** =shfmt= :package:
2119
2116#+begin_src emacs-lisp :noweb-ref modes 2120#+begin_src emacs-lisp :noweb-ref modes
2117 (when (executable-find "shfmt") 2121 (when (executable-find "shfmt")
2118 (reformatter-define sh-format 2122 (reformatter-define sh-format
@@ -2123,9 +2127,14 @@ installed.
2123 (add-hook 'sh-mode-hook #'sh-format-on-save-mode)) 2127 (add-hook 'sh-mode-hook #'sh-format-on-save-mode))
2124#+end_src 2128#+end_src
2125 2129
2130***** =sh-mode= indenting
2131
2132I'm trying to make this match what =shfmt= does as much as I can, to avoid the
2133reformatting when saving.
2134
2126#+begin_src emacs-lisp :noweb-ref settings 2135#+begin_src emacs-lisp :noweb-ref settings
2127 (setq-default sh-basic-offset 8 2136 (setq-default sh-basic-offset 8
2128 smie-indent-basic 8) 2137 sh-indent-after-case 0)
2129#+end_src 2138#+end_src
2130 2139
2131* Applications 2140* Applications