64 lines
1.5 KiB
Bash
Executable File
64 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
source "$SCRIPT_DIR/_lib.sh"
|
|
|
|
install_packages() {
|
|
local packages=(tmux vim git pspg bat fzf ripgrep)
|
|
local missing=()
|
|
for pkg in "${packages[@]}"; do
|
|
command -v "$pkg" &>/dev/null || missing+=("$pkg")
|
|
done
|
|
if [[ ${#missing[@]} -eq 0 ]]; then
|
|
echo "All packages already installed, skipping."
|
|
return
|
|
fi
|
|
echo "Installing missing packages: ${missing[*]}"
|
|
sudo apt update
|
|
sudo apt install -y "${missing[@]}"
|
|
}
|
|
|
|
install_tpm() {
|
|
if [[ ! -d ~/.tmux/plugins/tpm ]]; then
|
|
echo "Installing Tmux Plugin Manager..."
|
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
|
else
|
|
echo "Tmux Plugin Manager already installed, skipping."
|
|
fi
|
|
}
|
|
|
|
install_vundle() {
|
|
if [[ ! -d ~/.vim/bundle/Vundle.vim ]]; then
|
|
echo "Installing Vundle for Vim..."
|
|
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
|
else
|
|
echo "Vundle already installed, skipping."
|
|
fi
|
|
}
|
|
|
|
install_git_bash_prompt() {
|
|
if [[ ! -d ~/.bash-git-prompt ]]; then
|
|
echo "Installing git-bash-prompt..."
|
|
git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
|
|
else
|
|
echo "git-bash-prompt already installed, skipping."
|
|
fi
|
|
}
|
|
|
|
main() {
|
|
install_packages
|
|
bash "$SCRIPT_DIR/install_neovim.sh"
|
|
install_tpm
|
|
install_vundle
|
|
install_git_bash_prompt
|
|
deploy_configs
|
|
deploy_bin
|
|
bash "$SCRIPT_DIR/install_nvchad.sh"
|
|
deploy_nvim
|
|
echo ""
|
|
echo "Setup complete! Restart your shell or run 'source ~/.bashrc'."
|
|
}
|
|
|
|
main "$@"
|