mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-23 22:30:07 +00:00
common-aliases: Do not presume that $EDITOR (or $VISUAL for that matter) are always set
This commit is contained in:
parent
bc0433e518
commit
aa9043f5ea
1 changed files with 9 additions and 2 deletions
|
@ -58,8 +58,15 @@ if is-at-least 4.2.0; then
|
||||||
for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
|
for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
|
# open editable text files in text editor
|
||||||
for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
|
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
|
# open image files in image viewer
|
||||||
if [[ -n "$XIVIEWER" ]]; then
|
if [[ -n "$XIVIEWER" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue