From 53837a28d4d2227f1c5e0c719aa30576b0904b58 Mon Sep 17 00:00:00 2001 From: ArcheyDevil Date: Tue, 10 Apr 2012 13:37:04 +1000 Subject: [PATCH] Updated sprunge.plugin.zsh to use the file extention instead of using python to get the filetype. Which doesn't seem to work efficiently enough. Commented so it can be re-enabled if someone who knows python can extend it to work regardless. --- plugins/sprunge/sprunge.plugin.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index d2157de49..b71251fa8 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -18,11 +18,12 @@ HERE if (( $+commands[python] )); then # use python to attempt to detect the syntax sprunge_syntax() { - echo "try: - from pygments.lexers import get_lexer_for_filename - print(get_lexer_for_filename('$1').aliases[0]) -except: - print('text')" | python +# echo "try: +# from pygments.lexers import get_lexer_for_filename +# print(get_lexer_for_filename('$1').aliases[0]) +#except: +# print('text')" | python + echo ${1##*.}; } else # if we happen to lack python, just report everything as text