X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=default_plugins%2Fcheat%2Fcheat.zshrc;h=bfec74789441f60cc3fb727547b099316875493b;hb=043d8355a937b6418782bdb7a197ffa2e5c6cb06;hp=c36603211360ae272921f2ecaa443619eaeaedb2;hpb=cb27f63d82910325870c15e7132a9db690805501;p=ax-zsh.git diff --git a/default_plugins/cheat/cheat.zshrc b/default_plugins/cheat/cheat.zshrc index c366032..bfec747 100644 --- a/default_plugins/cheat/cheat.zshrc +++ b/default_plugins/cheat/cheat.zshrc @@ -1,13 +1,16 @@ # AX-ZSH: Alex' Modular ZSH Configuration # cheat: Setup http://cheat.sh +# Don't overwrite a real "cheat" command! +(( $+commands[cheat] )) && return + function cheat() { url="http://cheat.sh/$@?style=monokai" if (( $+commands[curl] )); then - curl "$url" + curl -s "$url" | ${PAGER:-less} elif (( $+commands[wget] )); then - wget -qO - "$url" + wget -qO - "$url" | ${PAGER:-less} else echo "Neither curl(1) nor wget(1) found!" >&2 return 1