summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-07-10 16:00:40 -0400
committerJesse Luehrs <doy@tozt.net>2021-07-10 16:00:40 -0400
commit7946924e237e059bb1b8ca311824042f69396e66 (patch)
tree939aa61f71784257a3b53fd8e89318a65b2d2f5e
parentf8aa9f87ddb7104d9d98f8c87c0d55a453a81a9c (diff)
downloadconf-7946924e237e059bb1b8ca311824042f69396e66.tar.gz
conf-7946924e237e059bb1b8ca311824042f69396e66.zip
add some shfmt config
-rw-r--r--Makefile5
-rw-r--r--vim/ftplugin/sh.vim1
2 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1d91b6c..6dea15b 100644
--- a/Makefile
+++ b/Makefile
@@ -119,7 +119,10 @@ versions :
updates :
$(GIT) submodule foreach -q 'if [ $$path == "vim/pack/filetype/start/perl" ]; then if [ $$(git rev-parse dev) != $$sha1 ]; then git lg dev...$$sha1; fi; else if [ $$(git rev-parse master) != $$sha1 ]; then git lg master...$$sha1; fi; fi'
-.PHONY: submodules build install clean update versions updates
+shfmt :
+ rg --files-without-match shfmt:skip $$(rg --files-with-matches '[#]!.*sh\b|[v]im:.*ft=.*sh\b') | grep -v "$$(echo $$(git submodule foreach -q 'echo $$sm_path') | sed 's/ /\\|/g')" | xargs shfmt -w -i 4
+
+.PHONY: submodules build install clean update versions updates shfmt
# installation targets
diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim
index 004cd12..728eb70 100644
--- a/vim/ftplugin/sh.vim
+++ b/vim/ftplugin/sh.vim
@@ -1,3 +1,4 @@
let b:is_bash = 1
let b:ale_fixers = { 'sh': ['shfmt'] }
let b:ale_fix_on_save = 1
+let b:ale_sh_shfmt_options = '-i 4'