lang/sh: make shfmt indent-style aware

Fixes #2905
This commit is contained in:
Henrik Lissner 2021-06-04 12:44:23 -04:00
parent 883a109a7a
commit 99fbdb1092

View file

@ -16,6 +16,10 @@
:config
(set-docsets! 'sh-mode "Bash")
(set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))
(set-formatter! 'shfmt
'("shfmt" "-ci"
("-i" "%d" (unless indent-tabs-mode tab-width))
("-ln" "%s" (pcase sh-shell (`bash "bash") (`mksh "mksh") (_ "posix")))))
(set-repl-handler! 'sh-mode #'+sh/open-repl)
(set-lookup-handlers! 'sh-mode :documentation #'+sh-lookup-documentation-handler)
(set-ligatures! 'sh-mode