Skip to content

Instantly share code, notes, and snippets.

@sevki
Created November 1, 2013 19:02
Show Gist options
  • Save sevki/7270263 to your computer and use it in GitHub Desktop.
Save sevki/7270263 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Quick shortcut to an editor.
#
# This means that as I travel back and forth between editors, hey, I don't have
# to re-learn any arcane commands. Neat.
#
# USAGE:
#
# $ e
# # => opens the current directory in your editor
#
# $ e .
# $ e /usr/local
# # => opens the specified directory in your editor
if test "$1" == ""
then
exec $EDITOR .
else
# BECAUSE FUCK
case $1 in
*_EDITMSG )
/usr/local/bin/emacsclient -t $1
;;
*MERGE_MSG )
/usr/local/bin/emacsclient -t $1
;;
*_TAGMSG )
/usr/local/bin/emacsclient -t $1
;;
* )
$EDITOR $1
;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment