#!/usr/bin/env bash if [ -z "$HOME" ]; then echo "Seems you're \$HOMEless :("; exit 1; fi COMMANDS="curl git stow" for COMMAND in $COMMANDS; do if ! command -v "$COMMAND" &> /dev/null; then echo "Please install $COMMAND"; exit 1; fi done DOTFILES=$HOME/.dotfiles DOTFZF=$HOME/.fzf DOTLOCAL=$HOME/.local/share/dotfiles GITCLONE="git clone --depth=1" if [ ! -d "$DOTFILES" ]; then git clone git@github.com:joshtronic/dotfiles.git "$DOTFILES" cd "$DOTFILES" || exit else cd "$DOTFILES" || exit git pull origin main fi rm -rf "$DOTFZF" "$DOTLOCAL" mkdir -p "$DOTLOCAL" stow git screen vim zsh $GITCLONE https://github.com/junegunn/fzf.git "$DOTFZF" "$DOTFZF/install" --key-bindings --completion --no-update-rc ZSHPLUGS=( "zsh-completions" "zsh-history-substring-search" "zsh-syntax-highlighting" ) for INDEX in ${!ZSHPLUGS[*]}; do ZSHPLUG="${ZSHPLUGS[$INDEX]}" $GITCLONE "https://github.com/zsh-users/$ZSHPLUG.git" "$DOTLOCAL/$ZSHPLUG" done VIMPLUGS=( # File exploration and navigation "junegunn/fzf.vim" # Languages and syntax "sheerun/vim-polyglot" # Style guide and linting "dense-analysis/ale" "editorconfig/editorconfig-vim" # TypeScript "leafgarland/typescript-vim" "Quramy/tsuquyomi" ) for INDEX in ${!VIMPLUGS[*]}; do VIMPLUG="${VIMPLUGS[$INDEX]}" PLUGDIR=$(echo "$VIMPLUG" | cut -d '/' -f2) $GITCLONE "https://github.com/$VIMPLUG.git" "$HOME/.vim/pack/plugins/start/$PLUGDIR" done cd "$HOME" || exit rm -f "${HOME}/.zcompdump*" echo echo "ENJOY! :)"