From: Alexander Barton Date: Sun, 24 May 2015 23:59:45 +0000 (+0200) Subject: "editor_select": Add "atom" editor X-Git-Url: https://arthur.barton.de/gitweb/?p=OhMyZshExtensions.git;a=commitdiff_plain;h=39d58109a744cf844d4ab296bee7f5edb534c76e "editor_select": Add "atom" editor Now we test for "atom", "mate", "sub", and "vim". In this order. --- diff --git a/plugins/editor_select/editor_select.plugin.zsh b/plugins/editor_select/editor_select.plugin.zsh index f7acfb4..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