dotfiles/home/private_dot_config/astronvim/executable_install.sh

65 lines
1.2 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
deps=(
2022-12-09 14:32:12 -06:00
rg # ripgrep
lazygit
gdu
btm # bottom
python
node
tree-sitter
)
# TODO: make sure tree-sitter is rust version?
is-cmd() {
2022-12-09 14:32:12 -06:00
if [ -x "$(command -v "$1")" ]; then
return 0
else
return 1
fi
}
2022-12-09 14:32:12 -06:00
install-astronvim() {
echo "Installing astronvim"
2022-12-09 14:32:12 -06:00
if [[ -d ~/.config/nvim ]]; then
echo "backing up old nvim config"
mv ~/.config/nvim ~/.config/nvim.bak-"$(date +'%s')"
fi
2022-12-09 14:32:12 -06:00
if [[ -d ~/.local/share/nvim ]]; then
echo "backing up old nvim directory"
mv ~/.local/share/nvim ~/.local/share/nvim-"$(date +'%s')"
mkdir ~/.local/share/nvim
fi
2022-12-09 14:32:12 -06:00
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
2023-02-06 12:01:03 -06:00
# echo "add brute force method of ignoring version complaints"
# git -C "$HOME/.config/nvim" am "$HOME/.config/astronvim/patches/0001-remove-version-check.patch"
2022-12-01 10:30:49 -06:00
2022-12-09 14:32:12 -06:00
nvim --headless -c 'autocmd User PackerComplete quitall'
}
echo "Checking for optional dependencies"
2022-12-09 14:32:12 -06:00
check-dep() {
if is-cmd "$1"; then
printf '%15s \033[32m%s\033[0m\n' "$1" 'yes'
else
printf '%15s \033[31m%s\033[0m\n' "$1" 'no'
fi
}
install-astronvim
2022-12-01 10:30:49 -06:00
echo
echo "checking for dependencies"
for dep in "${deps[@]}"; do
2022-12-09 14:32:12 -06:00
check-dep "$dep"
done