.dotfiles/configs/zsh/functions/cht.zsh

14 lines
369 B
Bash
Raw Normal View History

2022-01-26 20:42:58 +01:00
languages=`echo "golang lua cpp c typescript nodejs" | tr ' ' '\n'`
core_utils=`echo "xargs find mv sed awk" | tr ' ' '\n'`
function cht(){
selected=`printf "$languages\n$core_utils" | fzf`
read query\?"query:"
if printf $languages | grep -qs $selected; then
curl cht.sh/$selected/`echo $query | tr ' ' '+'`
else
curl cht.sh/$selected~$query
fi
}