# HG changeset patch # User Jeff Hammel # Date 1274894135 25200 # Node ID 3d111401010fda827cd3ae63574951c7465060d0 # Parent a9110cc98d94a743625862192c1d0e0d44bf9654 add a function to view the files in a diff diff -r a9110cc98d94 -r 3d111401010f .bashrc --- a/.bashrc Fri May 21 15:40:46 2010 -0700 +++ b/.bashrc Wed May 26 10:15:35 2010 -0700 @@ -43,12 +43,14 @@ # functions cdwin() { +# change directory to a window's location using its title DIR=$(xwininfo | dictify.py xwininfo | awk '{ print $NF }' | sed 's/"//g') DIR=${DIR/\~/$HOME} cd $DIR } eend() { +# edit the end of a file with emacs FILE=$1 shift emacs +`wc -l "$FILE"` $@ @@ -167,6 +169,7 @@ } swap() { +# swap two files if [ "$#" != "2" ] then echo "Usage: $FUNCNAME " @@ -195,6 +198,7 @@ } isrunning() { +# is a process running? (by name) for i in "$@" do ps axwww | grep "$i" | grep -v 'grep' @@ -203,6 +207,7 @@ } killbyname() { +# kill a process by name kill `isrunning "$@" | awk '{ print $1 }' | onelineit.py` } @@ -232,10 +237,12 @@ } pyfile() { +# python file name python -c "import $1; print $1.__file__" } svndance(){ +# do the svn import dance! if (( $# )) then svn import $1 @@ -248,6 +255,10 @@ fi } +difffiles() { +grep '^+++ ' $@ | sed 's/+++ b\///' +} + ### include overrides for commands source ~/.bash_overrides