From f0d8a2304e75c8c4c30afb18da5803e2ceddb122 Mon Sep 17 00:00:00 2001 From: Adam Hovorka Date: Sat, 12 Oct 2019 22:17:27 -0600 Subject: Sync misc changes 20191012 --- base/zsh/aliases.zsh | 1 + base/zsh/functions.zsh | 14 +++++++++++++- base/zsh/tipz.zsh | 11 +++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'base/zsh') diff --git a/base/zsh/aliases.zsh b/base/zsh/aliases.zsh index 7167d08..414cbbb 100644 --- a/base/zsh/aliases.zsh +++ b/base/zsh/aliases.zsh @@ -2,6 +2,7 @@ alias ls="ls --group-directories-first --color=auto" alias less='less -R' alias grep='grep --color=auto' +alias gdb='gdb -q' alias ..='cd ../' alias sudoe="sudo -E" diff --git a/base/zsh/functions.zsh b/base/zsh/functions.zsh index 57f11d3..f1a54f5 100644 --- a/base/zsh/functions.zsh +++ b/base/zsh/functions.zsh @@ -17,7 +17,9 @@ function trash { # 43 0 * * 3 find ~/.trash -mindepth 1 -mtime +90 -delete wttr() { - curl -q -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-Pleasant Grove}\?${2:-0q}" + curl -q -s --compressed -H "Accept-Language: ${LANG%_*}" \ + "https://wttr.in/${1:-Pleasant Grove}?${2:-0q}" + # "format=%l%0A%c+%t+%w+%m" } hex() { @@ -33,3 +35,13 @@ trc() { ssh dhd.ahov.co ssh aristotle transmission-remote-cli fi } + +httpless() { + http --pretty=all --print=hb "$@" | less -R +} + +colors() { + for i in `seq 0 21`; do + echo -ne "\e[48;5;${i}m ${i} " + done; echo -e "\e[0m" +} diff --git a/base/zsh/tipz.zsh b/base/zsh/tipz.zsh index bb1e224..fdcc058 100644 --- a/base/zsh/tipz.zsh +++ b/base/zsh/tipz.zsh @@ -1,3 +1,12 @@ +_tipz_ignore_list=("run-help") + +function _tipz_contains() { + local e match="$1" + shift + for e; do [[ "$e" == "$match" ]] && return 0; done + return 1 +} + ### # Search the defined aliases for a match ### @@ -18,6 +27,8 @@ function _tipz_find_match() { alias=$bits[1] command=$bits[2] + if _tipz_contains "$alias" "${_tipz_ignore_list[@]}"; then continue; fi + # Create a regex that finds an exact match for # the current argument string args="${(@)args[@]}" -- cgit v1.2.3-70-g09d2