# editor-select.plugin.zsh # 2015-04-02, alex@barton.de if [ -z "$EDITOR" ]; then # Check "mate" EDITOR=`which mate 2>/dev/null` if [ $? -eq 0 ]; then EDITOR="$EDITOR --wait" else # Check "subl" EDITOR=`which subl 2>/dev/null` if [ $? -eq 0 ]; then EDITOR="$EDITOR --wait" else # Check "vim" EDITOR=`which vim 2>/dev/null` if [ $? -ne 0 ]; then # Check "vi" EDITOR=`which vi 2>/dev/null` fi fi fi fi if [ -n "$EDITOR" ]; then export EDITOR alias zshrc="$EDITOR ~/.zshrc" fi