common-aliases: check if $XIVIEWER is defined and minor fixes

This commit is contained in:
Marc Cornellà 2016-11-02 11:17:58 +01:00
parent e57787bead
commit 0f62b7a8d8

View file

@ -55,15 +55,17 @@ alias mv='mv -i'
if is-at-least 4.2.0; then if is-at-least 4.2.0; then
# open browser on urls # open browser on urls
if [[ -n "$BROWSER" ]]; then if [[ -n "$BROWSER" ]]; then
_browser_fts=(htm html de org net com at cx nl se dk dk) _browser_fts=(htm html de org net com at cx nl se dk)
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) _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
for ft in $_editor_fts; do alias -s $ft=$EDITOR; done for ft in $_editor_fts; do alias -s $ft=$EDITOR; done
_image_fts=(jpg jpeg png gif mng tiff tif xpm) if [[ -n "$XIVIEWER" ]]; then
for ft in $_image_fts; do alias -s $ft=$XIVIEWER; done _image_fts=(jpg jpeg png gif mng tiff tif xpm)
for ft in $_image_fts; do alias -s $ft=$XIVIEWER; done
fi
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm) _media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
for ft in $_media_fts; do alias -s $ft=mplayer; done for ft in $_media_fts; do alias -s $ft=mplayer; done
@ -85,4 +87,3 @@ fi
# Make zsh know about hosts already accessed by SSH # Make zsh know about hosts already accessed by SSH
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })' zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'