X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=OhMyZshExtensions.git;a=blobdiff_plain;f=plugins%2Feditor_select%2Feditor_select.plugin.zsh;fp=plugins%2Feditor_select%2Feditor_select.plugin.zsh;h=f592886ce669a865b78e0b0d8c7731fff144018e;hp=f7acfb468aae1ce055a91bd8f8f6b78c10467ec8;hb=39d58109a744cf844d4ab296bee7f5edb534c76e;hpb=ad6a6ced0f530770cb7c73cc0d484148cf862298 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