From dbd72104cf715daacf74059a3c2f46133ace8b42 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 11 Apr 2009 14:47:23 +0200 Subject: suffix aliases: A little less eval madness --- etc/aliases/suffix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'etc/aliases') 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 -- cgit v1.2.3