diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-11 14:47:23 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-11 14:47:23 +0200 |
commit | dbd72104cf715daacf74059a3c2f46133ace8b42 (patch) | |
tree | e1e7357ae296be86b74e5dd91addcd966921b785 /etc/aliases | |
parent | 26eef76ba9c49286293f9578c19cb4e3c57c9cfa (diff) |
suffix aliases: A little less eval madness
Diffstat (limited to 'etc/aliases')
-rw-r--r-- | etc/aliases/suffix | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/aliases/suffix b/etc/aliases/suffix index 548da60..0c65430 100644 --- a/etc/aliases/suffix +++ b/etc/aliases/suffix @@ -2,17 +2,19 @@ ## Like, enter "somefile.ogg" and zsh will automatically open it using $audio_app ## vim:ft=zsh -archive_app='extr' -audio_app='mplayer' -document_app='kpdf' -image_app='feh' -video_app='mplayer' +typeset -A alias_apps +alias_apps=( + archive extr + audio mplayer + document kpdf + image feh + video mplayer +) for meta in ${parameters[(I)mime_*]#mime_}; { for format in $(eval echo "$"mime_$meta); { - eval alias -s $format="$"${meta}_app + alias -s $format=$alias_apps[$meta] } - unset ${meta}_app } -unset filetypes meta format +unset filetypes meta format alias_apps |