#!/bin/bash # A simple script for managing a vimwiki git repo. # Allows slightly simpler edits and commits. if [ $# -eq 0 ] || [ $1 = "edit" ]; then vim +VimwikiIndex exit fi pushd ~/vimwiki/ case $1 in commit) shift if [ $# -eq 0 ]; then msg="$(date --rfc-email)" else msg="$@" fi git add -A git commit -m "$msg" ;; ammend) shift if [ $# -eq 0 ]; then git commit --amend else msg="$@" git commit --amend -m "$msg" fi ;; *) eval "git $@" ;; esac