put the platform tests at the beginning of the file. clean out some unused stuff.
This commit is contained in:
parent
bd790936ca
commit
2a20fc6e73
1 changed files with 33 additions and 39 deletions
72
zsh/zshrc
72
zsh/zshrc
|
|
@ -1,29 +1,35 @@
|
||||||
# contents: zsh(1) user RC file.
|
# sniff out the platform
|
||||||
# this file is sourced by all interactive shells
|
uname=`uname -s`
|
||||||
|
function linux() { [[ "$uname" = "Linux" ]] }
|
||||||
|
function mac() { [[ "$uname" = "Darwin" ]] }
|
||||||
|
|
||||||
|
|
||||||
# 1. Environment Vars
|
# 1. Environment Vars
|
||||||
# ===================
|
# ===================
|
||||||
|
|
||||||
export RIAK=~/Projects/ssa/riak/riak/rel/riak
|
export RIAK=~/Projects/ssa/riak/riak/rel/riak
|
||||||
export CAPP_BUILD=~/Projects/ssa/cappuccino/cappuccino/Build
|
export CAPP_BUILD=~/Projects/ssa/cappuccino/cappuccino/Build
|
||||||
export NARWHAL_ENGINE=jsc
|
if mac; then
|
||||||
|
export NARWHAL_ENGINE=jsc
|
||||||
|
fi
|
||||||
|
|
||||||
export LC_ALL="en_CA.UTF-8"
|
export LC_ALL="en_CA.UTF-8"
|
||||||
export LANG="en_CA.UTF-8"
|
export LANG="en_CA.UTF-8"
|
||||||
|
|
||||||
cdpath=(~)
|
cdpath=(~)
|
||||||
|
|
||||||
uname=`uname -s`
|
|
||||||
function linux() { [[ "$uname" = "Linux" ]] }
|
|
||||||
function mac() { [[ "$uname" = "Darwin" ]] }
|
|
||||||
|
|
||||||
HOSTNAME=`hostname -s`
|
HOSTNAME=`hostname -s`
|
||||||
KEYCHAIN_HOST=`hostname`
|
KEYCHAIN_HOST=`hostname`
|
||||||
|
|
||||||
export PAGER=`which less`
|
if [[ "x$INSIDE_EMACS" != "x" ]] || [[ "$EMACS" = "t" ]]; then
|
||||||
# most has great colours for man pages
|
export PAGER=cat
|
||||||
if which most >/dev/null 2>&1; then
|
export MANPAGER=cat
|
||||||
export MANPAGER=`which most`
|
else
|
||||||
|
export PAGER=`which less`
|
||||||
|
# most has great colours for man pages
|
||||||
|
if which most >/dev/null 2>&1; then
|
||||||
|
export MANPAGER=`which most`
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# default editors
|
# default editors
|
||||||
|
|
@ -36,10 +42,11 @@ elif linux; then
|
||||||
export VISUAL="emacs"
|
export VISUAL="emacs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# 2. Limits
|
# 2. Limits
|
||||||
# =========
|
# =========
|
||||||
#limit coredumpsize 30m # limit core dumps to 30mb
|
# limit coredumpsize 30m # limit core dumps to 30mb
|
||||||
limit stacksize 8m # limit stack to 8mb
|
# limit stacksize 8m # limit stack to 8mb
|
||||||
|
|
||||||
# 3. Shell Options
|
# 3. Shell Options
|
||||||
# ================
|
# ================
|
||||||
|
|
@ -145,14 +152,9 @@ bindkey '\ep' history-beginning-search-backward
|
||||||
autoload -U promptinit
|
autoload -U promptinit
|
||||||
promptinit
|
promptinit
|
||||||
|
|
||||||
if [[ "x$INSIDE_EMACS" != "x" ]] || [[ "$EMACS" = "t" ]]; then
|
# Use my prompt theme, based on wunjo (zsh-git)
|
||||||
export PROMPT="%d %% "
|
prompt sjs
|
||||||
export PAGER=cat
|
|
||||||
export MANPAGER=cat
|
|
||||||
else
|
|
||||||
# Use my prompt theme, based on wunjo (zsh-git)
|
|
||||||
prompt sjs
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# 7. Aliases
|
# 7. Aliases
|
||||||
|
|
@ -216,43 +218,30 @@ alias lld='ls -dl'
|
||||||
alias irb='irb --readline -r irb/completion'
|
alias irb='irb --readline -r irb/completion'
|
||||||
alias rii='ri -Tf ansi'
|
alias rii='ri -Tf ansi'
|
||||||
|
|
||||||
# rails
|
|
||||||
alias ss='./script/server'
|
|
||||||
alias sc='./script/console'
|
|
||||||
alias km='kill `cat tmp/pids/mongrel.pid`'
|
|
||||||
|
|
||||||
# svn
|
|
||||||
alias sup='svn update'
|
|
||||||
alias sst='svn status -u'
|
|
||||||
alias scom='svn commit'
|
|
||||||
alias slog='svn log | less'
|
|
||||||
|
|
||||||
# git
|
# git
|
||||||
alias a='git add'
|
alias a='git add'
|
||||||
alias ap='git add -p'
|
alias ap='git add -p'
|
||||||
alias b='git branch'
|
alias b='git branch'
|
||||||
alias bt='git branch --track'
|
alias bt='git branch --track'
|
||||||
_bto() { git branch --track "$1" origin/"$1" }
|
alias bto='git-branch-track-origin'
|
||||||
alias bto='_bto'
|
|
||||||
alias c='git commit'
|
alias c='git commit'
|
||||||
alias co='git checkout'
|
alias co='git checkout'
|
||||||
alias d='git diff'
|
alias d='git diff'
|
||||||
alias dc='git diff --cached'
|
alias dc='git diff --cached'
|
||||||
alias ds='git diff --stat'
|
alias ds='git diff --stat'
|
||||||
|
alias g='git grep'
|
||||||
alias gl='git log'
|
alias gl='git log'
|
||||||
alias glo='git log --oneline'
|
alias glo='git log --oneline'
|
||||||
alias gls='git log --stat'
|
alias gls='git log --stat'
|
||||||
alias g='git grep'
|
alias gpr='git pull --rebase'
|
||||||
alias m='git merge'
|
alias m='git merge'
|
||||||
alias pob='git-pull-origin-branches'
|
alias pob='git-pull-origin-branches'
|
||||||
alias r='git remote'
|
alias r='git remote'
|
||||||
|
alias rbi='git rebase -i'
|
||||||
alias ra='git remote add'
|
alias ra='git remote add'
|
||||||
alias s='git status'
|
alias s='git status'
|
||||||
|
|
||||||
# macports apachectl
|
git-branch-track-origin() { git branch --track "$1" origin/"$1" }
|
||||||
if mac; then
|
|
||||||
alias -g apache2ctl=/opt/local/apache2/bin/apachectl
|
|
||||||
fi
|
|
||||||
|
|
||||||
git-pull-origin-branches() {
|
git-pull-origin-branches() {
|
||||||
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||||
|
|
@ -271,6 +260,11 @@ git-pull-origin-branches() {
|
||||||
git checkout $origbranch
|
git checkout $origbranch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# macports apachectl
|
||||||
|
if mac; then
|
||||||
|
alias -g apache2ctl=/opt/local/apache2/bin/apachectl
|
||||||
|
fi
|
||||||
|
|
||||||
function e() {
|
function e() {
|
||||||
"$EDITOR" "$@" >/dev/null &!
|
"$EDITOR" "$@" >/dev/null &!
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue