dotfiles/install
Josh Sherman 703768d712
Drop fzf installation, favor package manager installed version
My dotfiles rarely change, but the plugins and apps I use have regular
updates. I don't refresh my local dotfiles frequently, so it makes sense
to favor moving these things out of my installer and let the operating
system's package manager handle keeping them up to date.

Also left some notes for later when I get my new MBP.
2022-02-27 13:32:48 -06:00

71 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
if [ -z "$HOME" ]; then
echo "Seems you're \$HOMEless :("; exit 1;
fi
COMMANDS="curl fzf 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
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 "$DOTLOCAL"
mkdir -p "$DOTLOCAL"
stow git screen vim zsh
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! :)"