--- /dev/null
+#!/bin/bash
+# Install symlinks to dotfiles
+
+dolink()
+{
+ src="$1"
+ target="$2"
+
+ if [ -L "$target" ]; then
+ # Target is a symlink. Remove and recreate it just to be sure
+ echo "Relinking $src -> $target"
+ rm "$target"
+ ln -s "$src" "$target"
+ elif [ -e "$target" ]; then
+ # Target exists and is not a symlink. Report and do not relink.
+ echo "ERROR: target $target exists and is not a symlink" >&2
+ else
+ # Target does not exist. Create it.
+ ln -s "$src" "$target"
+ echo "Symlinking $src -> $target"
+ fi
+}
+
+cd ~
+
+dolink .dotfiles/vim .vim
+dolink .dotfiles/vimrc .vimrc