From bff64f2b0c34f0cae792c44d2646921d8e2db98d Mon Sep 17 00:00:00 2001 From: Sebastian Tramp Date: Sat, 17 Sep 2011 13:08:06 +0200 Subject: [PATCH] add wp, translate and gr function --- functions.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/functions.zsh b/functions.zsh index c4b04a7..f0ec71e 100644 --- a/functions.zsh +++ b/functions.zsh @@ -146,3 +146,22 @@ git-out() { git xlog $i done } + +# Query Wikipedia via console over DNS +# http://www.commandlinefu.com/commands/view/2829 +wp() { + dig +short txt ${1}.wp.dg.cx +} + +# translate via google language tools (more lightweight than leo) +# http://www.commandlinefu.com/commands/view/5034/ +translate() { + wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/' +} + +# cd to the root of the current vcs repository +gr() { + # vcsroot=`echo $vcs_info_msg_0_ | cut -d "|" -f 5` + vcsroot=`/home/seebi/.vim/scripts/vcsroot.sh` + echo $vcsroot && cd $vcsroot +}