Shell indentation and stuff
This commit is contained in:
parent
f961339555
commit
6baf30050f
15
config.org
15
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user