add rudimentary install script for astronvim
This commit is contained in:
parent
761e58ff50
commit
e531d5ec48
1 changed files with 57 additions and 0 deletions
57
home/private_dot_config/astronvim/install.sh
Normal file
57
home/private_dot_config/astronvim/install.sh
Normal file
|
@ -0,0 +1,57 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
deps=(
|
||||
rg # ripgrep
|
||||
lazygit
|
||||
gdu
|
||||
btm # bottom
|
||||
python
|
||||
node
|
||||
tree-sitter
|
||||
)
|
||||
|
||||
# TODO: make sure tree-sitter is rust version?
|
||||
|
||||
is-cmd() {
|
||||
if [ -x "$(command -v $1)" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
install-astronvim(){
|
||||
echo "Installing astronvim"
|
||||
|
||||
if [[ -d ~/.config/nvim ]]; then
|
||||
echo "backing up old nvim config"
|
||||
mv ~/.config/nvim ~/.config/nvim.bak-$(date +'%s')
|
||||
fi
|
||||
|
||||
if [[ -d ~/.local/share/nvim/site ]]; then
|
||||
echo "backing up old nvim site directory"
|
||||
mv ~/.local/share/nvim/site ~/.local/share/nvim/site.bak-$(date +'%s')
|
||||
fi
|
||||
|
||||
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
|
||||
nvim +PackerSync
|
||||
|
||||
}
|
||||
|
||||
echo "Checking for optional dependencies"
|
||||
|
||||
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
|
||||
|
||||
for dep in "${deps[@]}"; do
|
||||
check-dep "$dep"
|
||||
done
|
Loading…
Reference in a new issue