1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # cheat: Setup https://cht.sh
4 # Don't overwrite a real "cheat" command!
5 (( $+commands[cheat] )) && return
8 if (( $+commands[cht.sh] )); then
9 if [[ $# -eq 0 ]]; then
10 CHTSH_QUERY_OPTIONS="style=monokai" cht.sh --shell
12 CHTSH_QUERY_OPTIONS="style=monokai" cht.sh "$@" \
18 url="https://cht.sh/$@?style=monokai"
20 if (( $+commands[curl] )); then
21 curl -s "$url" | ${PAGER:-less}
22 elif (( $+commands[wget] )); then
23 wget -qO - "$url" | ${PAGER:-less}
25 echo "Neither cht.sh(1), curl(1) nor wget(1) found!" >&2