Mercurial > hg > config
changeset 66:91746c8abe0f
cleanup .bashrc
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 23 Apr 2010 15:40:46 -0700 |
parents | f47614ab462b |
children | a791d862148c |
files | .bashrc |
diffstat | 1 files changed, 44 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/.bashrc Mon Apr 19 13:24:41 2010 -0700 +++ b/.bashrc Fri Apr 23 15:40:46 2010 -0700 @@ -29,13 +29,17 @@ alias distribute='python setup.py egg_info -RDb "" sdist register upload' alias random="python -c 'import sys, random; foo = sys.argv[1:]; random.shuffle(foo); print \" \".join(foo)'" +# PROMPT PS1='> ' PS2='. ' PROMPT_COMMAND='echo -ne "\033]0;${SSH_CLIENT/*/$HOSTNAME:}${PWD/~/~}\007"' +# PATHs export PATH=~/bin:~/python:$PATH:/usr/sbin:/usr/games/bin export PYTHONPATH=~/python:$PYTHONPATH + +# functions cdwin() { DIR=$(xwininfo | dictify.py xwininfo | awk '{ print $NF }' | sed 's/"//g') DIR=${DIR/\~/$HOME} @@ -48,6 +52,28 @@ emacs +`wc -l "$FILE"` $@ } +function colors() { + + CLR_WHITE="\033[0;37m" + CLR_WHITEBOLD="\033[1;37m" + CLR_BLACK="\033[0;30m" + CLR_GRAY="\033[1;30m" + CLR_BLUE="\033[1;34m" + CLR_BLUEBOLD="\033[0;34m" + CLR_GREEN="\033[0;32m" + CLR_GREENBOLD="\033[1;32m" + CLR_CYAN="\033[0;36m" + CLR_CYANBOLD="\033[1;36m" + CLR_RED="\033[0;31m" + CLR_REDBOLD="\033[1;31m" + CLR_PURPLE="\033[0;35m" + CLR_PURPLEBOLD="\033[1;35m" + CLR_YELLOW="\033[0;33m" + CLR_YELLOWBOLD="\033[1;33m" + CLR_NOTHING="\033[0m" +} +colors + # nice fast find function EXCLUDES="(\.svn)|(\.mo$)|(\.po$)|(\.pyc$)" ff() { @@ -92,9 +118,25 @@ done } +# contextual fastfind +cff () { + + if (( $# < 2 )); then + local FILENAME='*' # default -- look in all files + else + local FILENAME=$2 + fi + + for i in `ff "$1" "$FILENAME"`; do + echo -e "$CLR_GREEN--->>> ""$CLR_YELLOWBOLD""$i""$CLR_NOTHING" : + grep --color=auto -i -n -C 3 "$1" $i + done + +} + +# make a temporary file tmpfile() { - if [ "$#" == "0" ] then args="." @@ -115,13 +157,11 @@ } edpe() { - # edit and pipe the buffer to stdout FILE=`tmpfile` $EDITOR $FILE cat $FILE rm $FILE - } swap() { @@ -184,7 +224,7 @@ less `which $@` } -#which emacs +# which emacs whemacs() { emacs -nw `which $@` } @@ -193,45 +233,6 @@ python -c "import $1; print $1.__file__" } -function colors() { - - CLR_WHITE="\033[0;37m" - CLR_WHITEBOLD="\033[1;37m" - CLR_BLACK="\033[0;30m" - CLR_GRAY="\033[1;30m" - CLR_BLUE="\033[1;34m" - CLR_BLUEBOLD="\033[0;34m" - CLR_GREEN="\033[0;32m" - CLR_GREENBOLD="\033[1;32m" - CLR_CYAN="\033[0;36m" - CLR_CYANBOLD="\033[1;36m" - CLR_RED="\033[0;31m" - CLR_REDBOLD="\033[1;31m" - CLR_PURPLE="\033[0;35m" - CLR_PURPLEBOLD="\033[1;35m" - CLR_YELLOW="\033[0;33m" - CLR_YELLOWBOLD="\033[1;33m" - CLR_NOTHING="\033[0m" -} - -colors - -# contextual fastfind -cff () { - - if (( $# < 2 )); then - local FILENAME='*' # default -- look in all files - else - local FILENAME=$2 - fi - - for i in `ff "$1" "$FILENAME"`; do - echo -e "$CLR_GREEN--->>> ""$CLR_YELLOWBOLD""$i""$CLR_NOTHING" : - grep --color=auto -i -n -C 3 "$1" $i - done - -} - svndance(){ if (( $# )) then