From fb0340b39272b50684dfc344752ce65ebd869900 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 25 Nov 2021 06:58:23 +0000 Subject: [PATCH] feature(vim-shfmt): add shellcheck, add vim-shfmt to vim-essentials --- vim-essentials/README.md | 1 + vim-essentials/install.sh | 1 + vim-shfmt/README.md | 11 +++++++++++ vim-shfmt/install.sh | 5 ++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/vim-essentials/README.md b/vim-essentials/README.md index e8df5ab..a4a39b4 100644 --- a/vim-essentials/README.md +++ b/vim-essentials/README.md @@ -23,6 +23,7 @@ It includes many of the vim plugins available on webinstall.dev such as: - [vim-viminfo](/vim-viminfo) - [vim-lastplace](/vim-lastplace) - [vim-spell](/vim-spell) +- [vim-shfmt](/vim-shfmt) - [vim-ale](/vim-ale) - [vim-prettier](/vim-prettier) - [vim-whitespace](/vim-whitespace) diff --git a/vim-essentials/install.sh b/vim-essentials/install.sh index 8c446b3..f536019 100644 --- a/vim-essentials/install.sh +++ b/vim-essentials/install.sh @@ -9,6 +9,7 @@ function __init_vim_essentials() { vim-lastplace \ vim-spell \ vim-ale \ + vim-shfmt \ vim-prettier \ vim-whitespace # done diff --git a/vim-shfmt/README.md b/vim-shfmt/README.md index b4d3737..3235e5a 100644 --- a/vim-shfmt/README.md +++ b/vim-shfmt/README.md @@ -22,6 +22,17 @@ let g:shfmt_extra_args = '-i 4 -sr -ci -s' let g:shfmt_fmt_on_save = 1 ``` +### Files + +```txt +~/.config/envman/PATH.env +~/.vimrc +~/.vim/pack/plugins/start/shfmt +~/.vim/plugins/shfmt.vim +~/.local/bin/shfmt +~/.local/bin/shellcheck +``` + ### How to install and configure manually 1. Clone `vim-shfmt` into your `~/.vim/pack/plugins/start`: diff --git a/vim-shfmt/install.sh b/vim-shfmt/install.sh index 62a0101..36aea7e 100644 --- a/vim-shfmt/install.sh +++ b/vim-shfmt/install.sh @@ -8,10 +8,13 @@ function __init_vim_shfmt() { rm -rf "$HOME/.vim/pack/plugins/start/vim-shfmt" git clone --depth=1 https://github.com/z0mbix/vim-shfmt.git "$HOME/.vim/pack/plugins/start/vim-shfmt" + export PATH="$HOME/.local/bin:${PATH}" if [ -z "$(command -v shfmt)" ]; then - export PATH="$HOME/.local/bin:${PATH}" webi shfmt fi + if [ -z "$(command -v shellcheck)" ]; then + webi shellcheck + fi if [ ! -f "$HOME/.vimrc" ]; then touch "$HOME/.vimrc"