X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=vim-ale%2Finstall.sh;fp=vim-ale%2Finstall.sh;h=4cb252ff18be98199e40c6e8af83428915d5e4b8;hb=7a14219d7d51d9f4cfa22b2bd7ce2ed47639be6e;hp=0000000000000000000000000000000000000000;hpb=77866561937dbc35454a02deb6e452320f5ba53d;p=webi-installers%2F.git diff --git a/vim-ale/install.sh b/vim-ale/install.sh new file mode 100644 index 0000000..4cb252f --- /dev/null +++ b/vim-ale/install.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +function __init_vim_ale() { + set -e + set -u + + mkdir -p "$HOME/.vim/pack/plugins/start" + rm -rf "$HOME/.vim/pack/plugins/start/ale" + git clone --depth=1 https://github.com/dense-analysis/ale.git "$HOME/.vim/pack/plugins/start/ale" + + if [ ! -f "$HOME/.vimrc" ]; then + touch "$HOME/.vimrc" + fi + + mkdir -p ~/.vim/plugins + if ! [ -f "$HOME/.vim/plugins/ale.vim" ]; then + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL -o ~/.vim/plugins/ale.vim "$WEBI_HOST/packages/vim-ale/ale.vim" + fi + + if ! grep 'source.*plugins.ale.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then + set +e + mkdir -p ~/.vim/plugins + printf '\n" ALE: reasonable defaults from webinstall.dev/vim-ale\n' >> ~/.vimrc + printf 'source ~/.vim/plugins/ale.vim\n' >> ~/.vimrc + set -e + echo "" + echo "add ~/.vim/plugins/ale.vim" + echo "updated ~/.vimrc with 'source ~/.vim/plugins/ale.vim'" + fi + + echo "" + echo "vim-ale enabled with reasonable defaults" + +} + +__init_vim_ale