shell stuff

pull/2/head
Bodaniel Jeanes 2010-11-22 13:53:19 +10:00
parent 3989f08846
commit 7cd251083d
7 changed files with 51 additions and 9 deletions

View File

@ -9,10 +9,11 @@ alias top='top -o cpu'
alias et="$EDITOR ."
alias sprof="reload"
alias eprof="$EDITOR $HOME/.config"
alias home="cd $HOME" # the tilde is too hard to reach
alias systail='tail -f -n0 /var/log/system.log'
alias aptail='tail -f -n0 /var/log/apache*/*log'
alias systail='tail -fn0 /var/log/system.log'
alias aptail='tail -fn0 /var/log/apache*/*log'
alias l='ls'
alias b='cd -'
@ -22,7 +23,7 @@ alias c='clear' # shortcut to clear your terminal
alias profileme="history | awk '{print \$2}' | awk 'BEGIN{FS=\"|\"}{print \$1}' | sort | uniq -c | sort -n | tail -n 20 | sort -nr"
# rails stuff
alias log='tail -f -0 ./log/*.log'
alias log='tail -fn0 ./log/*.log /var/log/apache*/*log'
alias ss='ruby ./script/server'
alias sc='ruby ./script/console'
alias gen='script/generate'

View File

@ -1,4 +1,4 @@
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/mongodb/bin:/usr/local/pgsql/bin:/usr/X11/bin:/opt/local/bin:${PATH}"
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/mongodb/bin:/usr/local/pgsql/bin:/usr/X11/bin:/opt/local/bin:${PATH}"
CDPATH=".:${HOME}"
source $DOT_FILES/$CURRENT_SHELL/config.*sh

View File

@ -1,3 +1,20 @@
function GET() {
curl -i -X GET -H "X-Requested-With: XMLHttpRequest" $*
}
function POST() {
curl -i -X POST -H "X-Requested-With: XMLHttpRequest" $*
#-d "key=val"
}
function PUT() {
curl -i -X PUT -H "X-Requested-With: XMLHttpRequest" $*
}
function DELETE() {
curl -i -X DELETE -H "X-Requested-With: XMLHttpRequest" $*
}
function f() { find * -name $1; }
function p() {
cd $* && m

View File

@ -1,5 +1,7 @@
[ `which hub` ] && alias git='hub'
alias gi='git init'
alias gst='git status'
alias gst='git status -s'
alias gl='git pull --rebase'
alias gp='git push'
alias gpa='git push-all' # see [alias] in ~/.gitconfig
@ -15,6 +17,7 @@ alias gk='gitk --all &'
alias gx="open -b nl.frim.GitX"
alias grm="git stat | grep deleted | awk '{print $3}' | xargs git rm"
alias gpatch='git diff master -p'
alias glg="git log --decorate --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias ignore_empty='find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;'
function gd() {

View File

@ -1,6 +1,9 @@
export EDITOR='mate -wl1'
export VISUAL=$EDITOR
export GIT_EDITOR=$EDITOR
export PATH="/Library/PostgreSQL8/bin/:$PATH"
CDPATH="${CDPATH}:${HOME}/Code/Mocra/:${HOME}/Code/Personal:${HOME}/Sites/Mocra/:${HOME}/Sites/Personal/"
CDPATH="${CDPATH}:${HOME}/Code/Mocra/:${HOME}/Code/Personal:${HOME}/Sites/Mocra:${HOME}/Sites/Personal:${HOME}/Sites/Client/"
alias o='open .'

View File

@ -46,7 +46,7 @@ function color {
if [ $CURRENT_SHELL = 'zsh' ]; then
echo "%{$chosen%}"
else
printf "$chosen"
printf $chosen®
fi
}

View File

@ -4,13 +4,29 @@ alias reload="source ~/.zshrc"
bindkey "\e\e[C" vi-forward-word
bindkey "\e\e[D" vi-backward-word
# # forward/back directories with Option+Up/Down
# function back-dir {
# cd -1 >/dev/null
# echo
# }
#
# function fwd-dir {
# cd +1 >/dev/null
# echo
# }
#
# zle -N back-dir back-dir
# zle -N fwd-dir fwd-dir
#
# bindkey "\e\e[A" back-dir
# bindkey "\e\e[B" fwd-dir
# http://www.scannedinavian.com/~shae/shae.zshrc
# These are options I've copied but yet to totally investigate if it's what I want
setopt alwaystoend # when complete from middle, move cursor
setopt completeinword # not just at the end
setopt correct # spelling correction
setopt histverify # when using ! cmds, confirm first
setopt interactivecomments # escape commands so i can use them later
setopt listpacked # compact completion lists
setopt noautomenu # don't cycle completions
setopt pushdignoredups # and don't duplicate them
@ -32,8 +48,10 @@ setopt extendedglob # awesome pattern matching (ala Dir.glob() in Rub
setopt promptcr # ensure a new line before prompt is drawn
setopt listtypes # show types in completion
setopt nocompletealiases # Allows alias 'ga' to use 'git add' completions (for example)
setopt interactivecomments # escape commands so i can use them later
# jump to each element in a path with m-f m-b, same
# for kill-word, etc.
export WORDCHARS=''
WORDCHARS=''