Thursday, July 14, 2011

Where does a normal person keep their most-current generic .zshrc file?  I don't know, so I decided to put a copy of mine here.


######### process an Sweave file, using caching #########
function sweaveCache() {
    Rscript -e "library(cacheSweave); setCacheDir(getwd()); Sweave('$1.Rnw', driver = cacheSweaveDriver)" &&
    pdflatex --shell-escape $1.tex &&
    open $1.pdf
}

runit() {
    echo $* 1>&2
    $*
}


########## Maven stuff ####################
export MAVEN_HOME=/usr/share/maven
function listMavenCompletions {
    reply=(cli:execute cli:execute-phase archetype:generate compile clean install test test-compile deploy package cobertura:cobertura jetty:run -Dmaven.test.skip=true -DarchetypeCatalog=http://tapestry.formos.com/maven-snapshot-repository -Dtest= `if [ -d ./src ] ; then find ./src -type f | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`);
}
compctl -K listMavenCompletions mvn

mvnrun() {
    runit mvn -q exec:java -Dexec.mainClass=$1 -Dexec.args="$*[2,-1]"
}
##############


########## Hadoop stuff ####################
export HADOOP_HOME=blah

export hdtracker=blah

doop() {
  if [[ $# < 1 ]]; then
      echo "Usage: doop " >&2
      return 1
  fi

  vars=(-Dfs.default.name=hdfs://$hdtracker/ -Dmapred.job.tracker=$hdtracker:8021)
  if [[ $1 == "jar" ]]; then
      runit hadoop $*[1,2] $vars $*[3,-1]
  else
      runit hadoop $1 $vars $*[2,-1]
  fi
}

alias doopstream="doop jar \$HADOOP_HOME/contrib/streaming/hadoop-*-streaming.jar"
##############

p4v=/Applications/Computer/p4v.app/Contents/MacOS/p4v

# Doesn''t work with absolute path
timelapse() {
    $p4v -cmd "annotate $PWD/$1" &
}
##############

prompt="[%U%m%u:%B%~%b] %% "
path=( /bin /etc /usr/bin /usr/etc /usr/sbin /sbin ~/bin /usr/local/bin ~/p4/tools/FileTools ~/p4/tools/perforce /usr/local/git/bin /usr/local/mysql/bin /usr/local/texlive/2009/bin/universal-darwin $HADOOP_HOME/bin . )

REPORTTIME=5

HISTSIZE=1000000000
SAVEHIST=1000000000
HISTFILE=~/.history

setopt extendedhistory
setopt incappendhistory

bindkey ^W kill-region

export P4CONFIG=.p4config
export P4DIFF="diff -u"
#export LC_ALL=C
export CVS_RSH=ssh
export PAGER=less
export EDITOR=emacs
export LESS=-eiMq

export DYLD_LIBRARY_PATH=blah
export http_proxy=blah


alias e=aquamacs
alias ls="ls -FG"
alias lsl="ls -alFG"
alias j=jobs
alias h=history
alias up='tar -zxvf'
alias top="top -u"
alias ql='quicklook -p'

alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias cds="cd ~/src"
alias cdd="cd ~/Downloads"
alias cdp="cd ~/p4"

alias cpan='perl -MCPAN -e shell'
alias findproc='ps auxww | grep'
alias disk='df -h | grep -v :'
alias mac2unix='perl -pi -e "s/\cM/\n/g"'
alias dos2unix='perl -pi -e "s/\cM//g"'
alias pert='perl -a -F/\\t/'

fpath=(~/.zfuncs $fpath)

reload_funcs() {
    local f
    f=(~/.zfuncs/*(.))
    unfunction $f:t
    autoload -U $f:t
}

0 Comments:

Post a Comment

<< Home