1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # editor_select.zprofile: Setup $EDITOR for the "best" available editor
4 if [[ -n "$EDITOR" && ! -x "$EDITOR" && -z "$commands[$EDITOR]" ]]; then
5 # Oops, current $EDITOR seems to be invalid! Start over!
9 if [[ -z "$EDITOR" ]]; then
10 # Auto-detect a "good" editor ...
11 if [[ -n "$DISPLAY" ]]; then
12 # X11 available, consider X11-based editors, too!
17 code atom mate subl mvim
21 if [[ -n "$commands[$editor]" ]]; then
22 EDITOR="$commands[$editor]"
26 unset editor x11_editors
30 "code"|"atom"|"mate"|"subl")
31 EDITOR="$EDITOR --wait"
34 EDITOR="$EDITOR --nofork"
38 [[ -n "$EDITOR" ]] && export EDITOR