#!/bin/sh # Installs the Neovim config only; Neovim itself must already be installed. set -eu repo_url='https://git.sailorpunisher.com/sailor/nvim-config.git' target="${XDG_CONFIG_HOME:-$HOME/.config}/nvim" mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}" if [ -d "$target/.git" ]; then git -C "$target" pull --ff-only exit 0 fi if [ -e "$target" ]; then backup="${target}.bak-$(date +%Y%m%d-%H%M%S)" mv "$target" "$backup" fi git clone "$repo_url" "$target"