1
0
chezmoi/home/.chezmoiscripts/run_onchange_after_80-install-nvim.sh.tmpl
2024-03-01 13:56:38 +01:00

84 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# Logging function
log() {
printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
}
inf() {
printf "$(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
}
# Packages to install
packages=(
rustup
go
neovim
npm
python-pip
python-pynvim
ripgrep
)
log "Begin LVim installation"
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
## Update system
inf "updating system..."
yay -Syu --noconfirm --quiet
## Install packages
for package in ${packages[@]}; do
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
inf "installing ${package}..."
yay -S --noconfirm --quiet $package
fi
done
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
export DEBIAN_FRONTEND=noninteractive
## Update system
inf "updating system..."
{{- if ne .chezmoi.username "root" }}
sudo -E apt update -qq
sudo -E apt upgrade --yes -qq
{{- else }}
apt update -qq
apt upgrade --yes -qq
{{- end}}
## Install packages
packages[1]=golang
packages=(${packages[@]/python/python3})
packages=(${packages[@]/neovim/})
packages+=(python3-venv)
for package in ${packages[@]}; do
inf "installing ${package}..."
{{- if ne .chezmoi.username "root" }}
sudo -E apt-get install --yes --no-install-recommends --ignore-missing --fix-broken -qq $package
{{- else }}
apt-get install --yes --no-install-recommends --ignore-missing --fix-broken -qq $package
{{- end }}
done
inf "installing neovim..."
mist install neovim
{{- end }}
inf "installing lvim..."
LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s 'https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh')
log "Finish LVim installation"