add wp, translate and gr function

master
Sebastian Tramp 2011-09-17 13:08:06 +02:00
parent 2d88d1fd2f
commit bff64f2b0c
1 changed files with 19 additions and 0 deletions

View File

@ -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
}