Skip to content

Instantly share code, notes, and snippets.

@mike-burns
Created July 22, 2011 13:07
Show Gist options
  • Save mike-burns/1099416 to your computer and use it in GitHub Desktop.
Save mike-burns/1099416 to your computer and use it in GitHub Desktop.
## agrep
# History grep, process grep
autoload hgrep pg
## android
export ANDROID_HOME=/usr/local/android-sdk-linux_86
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
launch() {
# for example, com.thoughtbot.hoptoad/.ErrorsActivity'
if [ $# -eq 0 ]; then
echo "usage: launch <package>/.<main-activity>"
echo "for example: launch com.thoughtbot.hoptoad/.ErrorsActivity"
else
adb -e shell "am start -a android.intent.action.MAIN -n $1"
fi
}
## debian
export PATH=$PATH:/var/lib/gems/1.8/bin:/sbin:/usr/sbin:/usr/local/sbin
export PAGER=/usr/bin/less
[[ "$terminfo[kcuu1]" == "O"* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" up-line-or-history
[[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" up-line-or-history
# Sockets
alias c='sockstat -c'
# Colors in grep
alias grep='grep --color'
# Pretty ls
alias ls='/bin/ls -Fh --color'
# apt
alias ai='sudo aptitude install'
alias as='aptitude search'
alias au='sudo aptitude update && sudo aptitude safe-upgrade'
# Show the contents of a directory when changing to it.
# Copied here because of the `ls' alias
if echo $TERM | grep xterm > /dev/null; then
# Also show the computer and path in the titlebar
function chpwd {
print -Pn "\033]2;%m - %~\007"
ls
}
print -Pn "\033]2;%m - %~\007"
else
function chpwd {
ls
}
fi
## gnome
# Shortcut for opening files quickly
alias o='gnome-open'
alias open='gnome-open'
## haskell
# cabal
export PATH=$HOME/.cabal/bin:$PATH
## local
export PYGMENTIZE_BIN=`which pygmentize`
export EYRC=./.eyrc
export VISUAL=~/.zsh/funcs/gvim_fg
export PAGER='/usr/bin/less -R'
alias irc='ssh -t mike@mike-burns.com screen -rd'
alias deploycrowd="ey deploy -e crowdtap_staging -a crowdtap --ref master --migrate='rake mongoid:migrate'"
alias ci='git push build' # ci branchname
alias ack=ack-grep
autoload awesomize grasset craigslisterize gvim_fg
# Rake completion
source ~/.zsh/rake_completion.zsh
echo "See your todo list: todo"
# feature tests in autotest
## rails
export AUTOFEATURE=true
# git
alias gs='git status -sb'
alias ga='(git add . && git add -u); git status -sb'
alias gp='git pull --rebase'
# Rails shortcuts
alias sc='./script/rails c'
alias sg='./script/rails g'
alias remigrate="rake db:migrate && rake db:migrate:redo && rake db:schema:dump db:test:prepare"
alias cuc='bundle exec cucumber'
alias rake='bundle exec rake'
alias be='bundle exec'
## rvm
# RVM
if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi
# relax, postgres
export PGOPTIONS='-c client_min_messages=WARNING'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
alias rm='/bin/rm -i'
alias mv='/bin/mv -i'
alias cdbk='cd "$OLDPWD"'
alias n=newest
alias j=jobs
alias ...='../..'
alias mkdir='mkdir -p'
alias d='cd ~/.dotfiles'
alias ln='ln -v'
alias -g G='| grep'
alias -g M='| less'
alias -g L='| wc -l'
alias -g ONE="| awk '{ print \$1}'"
## Show the contents of a directory when changing to it.
function chpwd {
ls
}
autoload newest mvbk vg g bk
PROMPT='[%{%}%U%n@%m%u%{%}] %~%# '
PS2='[%_] %# '
FPATH=$FPATH:$HOME/.zsh/funcs
PATH=$HOME/.bin:$PATH
HISTFILE=$HOME/.zsh/history
SAVEHIST=1000
HISTSIZE=1000
READNULLCMD=less
EDITOR=vim
VISUAL=vim
LESS=eCM
LSCOLORS=EhfxcxdxCxegedabagacad
cdpath=(~)
hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\*}%%,*} )
export EDITOR VISUAL LSCOLORS LESS PATH NNTPSERVER COLUMNS
setopt histignoredups
setopt histignorespace
setopt extendedglob
setopt correct
setopt auto_cd
setopt complete_in_word
unsetopt promptcr
setopt hist_ignore_space
setopt AUTO_PUSHD
export DIRSTACKSIZE=5
compctl -X "Options:" -o setopt
compctl -X "Keybindings:" -b bindkey
# By default, complete filenames or from the history
compctl -D -f + -H 0 ''
# cd to directories
compctl -g '*(/-D)' + -f cd
bindkey -v
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
bindkey "^P" history-search-backward
bindkey "^R" history-incremental-search-backward
bindkey "^Y" accept-and-hold
bindkey "^N" insert-last-word
bindkey "^[OP" run-help
bindkey -s "^T" "^[Isudo ^[A"
bindkey jj vi-cmd-mode
umask 002
if [ -d $HOME/.zsh/configs ]; then
for config ($HOME/.zsh/configs/*) source $config
fi
# Colorize tab completions
if (( $+commands[dircolors] )); then
autoload compinit && compinit
eval $(dircolors)
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment