Add autoinstall for packages (vim-plug, starship, ...)

This commit is contained in:
Tobias Reisinger 2022-09-13 21:28:05 +02:00
parent e448e719e8
commit 866bbcae20
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 57 additions and 101 deletions

23
.bin/autoinstall-packages Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env sh
vim_autoload_dir="$HOME/.config/vim/autoload"
if [ ! -f "$vim_autoload_dir/plug.vim" ]
then
mkdir -p "$vim_autoload_dir"
cd "$vim_autoload_dir" || exit
curl -o "plug.vim" "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
[ -x "$(command -v vim)" ] && yes | vim +'PlugInstall --sync' +qa --not-a-term
fi
nvim_dir="$HOME/.config/nvim"
if [ ! -d "$nvim_dir" ]
then
git clone https://github.com/AstroNvim/AstroNvim "$nvim_dir"
[ -x "$(command -v nvim)" ] && nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
fi
if [ ! -x "$(command -v starship)" ]
then
mkdir -p "$HOME/.local/bin"
curl -sS "https://starship.rs/install.sh" | BIN_DIR="$HOME/.local/bin" FORCE=1 sh
fi