Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Last active May 24, 2017 17:46
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save ttscoff/5277629 to your computer and use it in GitHub Desktop.
Save ttscoff/5277629 to your computer and use it in GitHub Desktop.
A replacement EDITOR variable for using different editors based on filetypes
#!/bin/bash
case "$1" in
*_EDITMSG|*MERGE_MSG|*_TAGMSG )
/usr/local/bin/vim "$1"
;;
*.md )
/usr/local/bin/mmdc "$1"
;;
*.txt )
/usr/local/bin/mmdc "$1"
;;
* )
/usr/local/bin/subl -w "$1"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment