#!/bin/sh readonly VIM_PLUGS="$HOME/.vim/pack/plugins/start" # Clones a Git repository into $VIM_REPO_DIR if the repository does not already # exist there. # # $1: Repository URL # $2 (optional): Branch clone_plugin() { path="${VIM_REPO_DIR}/$(basename "$1")" if [ -d "$path" ]; then return fi if [ -n "$2" ]; then git clone -b "$2" "$1" "$path" else git clone "$1" "$path" fi ln -s "$path" "$VIM_PLUGS" } mkdir -p "$HOME"/tmp mkdir -p "$HOME"/.cache rm -f "$HOME"/.bash_profile find "$PWD" -maxdepth 1 \ -name '.*' \ -not -name .git \ -not -name .DS_Store \ -not -name .gitignore \ -exec ln -sf {} "$HOME" \; if [ "$(uname)" = FreeBSD ]; then rm "$HOME"/.editrc ln -sf "$PWD"/freebsd/.editrc "$HOME" fi # When using a separate case-sensitive volume for src on Mac, we need to put # a copy of .editorconfig at the root of that filesystem. # if [ "$(uname)" = Darwin ]; then ln -sf "$PWD"/.editorconfig /Volumes/src/.editorconfig fi if [ "$(uname)" = Linux ]; then ln -sf "$HOME"/.profile "$HOME"/.bash_profile; ln -sf "$HOME"/.shrc "$HOME"/.bashrc; fi if command -v vim >/dev/null; then mkdir -p "$VIM_REPO_DIR" "$VIM_PLUGS" clone_plugin https://git.linskey.org/ale/ clone_plugin https://git.linskey.org/ctrlp.vim/ clone_plugin https://git.linskey.org/halation.vim/ # Regenerate Vim help tags. vim -e -s -u NONE -c 'helptags ALL' -c q; fi