X-Git-Url: https://arthur.barton.de/gitweb/?p=OhMyZshExtensions.git;a=blobdiff_plain;f=plugins%2Feditor_select%2Feditor_select.plugin.zsh;h=f592886ce669a865b78e0b0d8c7731fff144018e;hp=ed20a0258af29d4a259a409011924cd93037de70;hb=39d58109a744cf844d4ab296bee7f5edb534c76e;hpb=b5e50d51c2f7cfe2a268cf788ae906dcf2f55cb3 diff --git a/plugins/editor_select/editor_select.plugin.zsh b/plugins/editor_select/editor_select.plugin.zsh index ed20a02..f592886 100644 --- a/plugins/editor_select/editor_select.plugin.zsh +++ b/plugins/editor_select/editor_select.plugin.zsh @@ -2,21 +2,27 @@ # 2015-04-02, alex@barton.de if [ -z "$EDITOR" ]; then - # Check "mate" - EDITOR=`which mate 2>/dev/null` + # Check "atom" + EDITOR=$(which atom 2>/dev/null) if [ $? -eq 0 ]; then EDITOR="$EDITOR --wait" else - # Check "subl" - EDITOR=`which subl 2>/dev/null` + # Check "mate" + EDITOR=$(which mate 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` + # 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