1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-23 14:20:08 +00:00

common-aliases: Do not presume that $EDITOR (or $VISUAL for that matter) are always set

This commit is contained in:
Alexander Schlarb 2018-08-09 20:47:16 +02:00
parent bc0433e518
commit aa9043f5ea

View file

@ -58,8 +58,15 @@ if is-at-least 4.2.0; then
for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
fi
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
# open editable text files in text editor
if [[ -n "$VISUAL" ]] || [[ -n "$EDITOR" ]]; then
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
if [[ -n "$VISUAL" ]]; then
for ft in $_editor_fts; do alias -s $ft='$VISUAL'; done
else
for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
fi
fi
# open image files in image viewer
if [[ -n "$XIVIEWER" ]]; then