"editor_select": Add "atom" editor
authorAlexander Barton <alex@barton.de>
Sun, 24 May 2015 23:59:45 +0000 (01:59 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 24 May 2015 23:59:45 +0000 (01:59 +0200)
Now we test for "atom", "mate", "sub", and "vim". In this order.

plugins/editor_select/editor_select.plugin.zsh

index f7acfb468aae1ce055a91bd8f8f6b78c10467ec8..f592886ce669a865b78e0b0d8c7731fff144018e 100644 (file)
@@ -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