add wp, translate and gr function
This commit is contained in:
parent
2d88d1fd2f
commit
bff64f2b0c
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue