]> arthur.barton.de Git - ax-zsh.git/blob - plugins/editor_select/editor_select.zprofile
Don't hardcode default plugins, read them from ./default_plugins/
[ax-zsh.git] / plugins / editor_select / editor_select.zprofile
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # editor_select.zprofile: Setup $EDITOR for the "best" available editor
3
4 if [[ -z "$EDITOR" ]]; then
5         for editor in atom mate subl vim nano joe vi; do
6                 if [ -n "$commands[$editor]" ]; then
7                         EDITOR="$commands[$editor]"
8                         break
9                 fi
10         done
11         unset editor
12 fi
13
14 case "$(basename "$EDITOR")" in
15         "atom"|"mate"|"subl")
16                 EDITOR="$EDITOR --wait"
17                 ;;
18 esac
19
20 if [ -n "$EDITOR" ]; then
21         export EDITOR
22         alias zshenv="$EDITOR ~/.zshenv"
23 fi