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.

This commit is contained in:
ArcheyDevil 2012-04-10 13:37:04 +10:00
commit 53837a28d4

View file

@ -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