Quite a few updates to leverage GNU `stow` and reduce the manual efforts in the install script. Localized my `[n]vim` color scheme of choice since it hasn't been updated in years. Also updated the installer to pull from remote instead of completely removing itself if it's already present. Contemplating moving to using some plugin managers for `zsh` and `[n]vim` to help reduce the install size a bit more, and to provide a bit more flexibility for anybody else running this.
75 lines
1.5 KiB
Bash
Executable file
75 lines
1.5 KiB
Bash
Executable file
#!/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! :)"
|