mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
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:
parent
5641da62ee
commit
53837a28d4
1 changed files with 6 additions and 5 deletions
|
|
@ -18,11 +18,12 @@ HERE
|
||||||
if (( $+commands[python] )); then
|
if (( $+commands[python] )); then
|
||||||
# use python to attempt to detect the syntax
|
# use python to attempt to detect the syntax
|
||||||
sprunge_syntax() {
|
sprunge_syntax() {
|
||||||
echo "try:
|
# echo "try:
|
||||||
from pygments.lexers import get_lexer_for_filename
|
# from pygments.lexers import get_lexer_for_filename
|
||||||
print(get_lexer_for_filename('$1').aliases[0])
|
# print(get_lexer_for_filename('$1').aliases[0])
|
||||||
except:
|
#except:
|
||||||
print('text')" | python
|
# print('text')" | python
|
||||||
|
echo ${1##*.};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# if we happen to lack python, just report everything as text
|
# if we happen to lack python, just report everything as text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue