Skip to content

Commit

Permalink
zsh closeout sale, everything must go!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
wsc committed Aug 8, 2011
1 parent 3c56494 commit 1306b70
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 284 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion zlogin

This file was deleted.

2 changes: 1 addition & 1 deletion zsh/01_path
Original file line number Diff line number Diff line change
@@ -1 +1 @@
path=(~/.rbenv/shims ~/.rbenv/bin/ ~/bin ~/usr/local/bin $path)
path=(~/.rbenv/shims ~/.rbenv/bin/ ~/bin /usr/local/bin $path)
8 changes: 8 additions & 0 deletions zsh/02_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
setopt hist_ignore_dups
setopt hist_verify
setopt inc_append_history
setopt extended_history # Timestamp history
setopt hist_ignore_space
HISTFILE=$HOME/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
21 changes: 0 additions & 21 deletions zsh/02_options

This file was deleted.

25 changes: 6 additions & 19 deletions zsh/07_completion.old → zsh/03_completion
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# fixme - the load process here seems a bit bizarre

unsetopt menu_complete # do not autoselect the first completion entry
unsetopt menu_complete
unsetopt flowcontrol
setopt auto_menu # show completion menu on succesive tab press
setopt always_last_prompt
setopt auto_menu
setopt complete_in_word
setopt always_to_end

WORDCHARS=''

zmodload -i zsh/complist

## case-insensitive (all),partial-word and then substring completion
Expand All @@ -19,19 +16,8 @@ else
fi

zstyle ':completion:*' list-colors ''

# should this be in keybindings?
bindkey -M menuselect '^o' accept-and-infer-next-history

zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"

# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
cdpath=(.)

# use /etc/hosts and known_hosts for hostname completion
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=(
Expand All @@ -42,7 +28,7 @@ hosts=(
)
zstyle ':completion:*:hosts' hosts $hosts

# Use caching so that commands like apt and dpkg complete are useable

zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/

Expand All @@ -56,6 +42,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
operator pcap postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs

# ... unless we really want to.
# Unless we want to
zstyle '*' single-ignored show


79 changes: 0 additions & 79 deletions zsh/06_alias
Original file line number Diff line number Diff line change
Expand Up @@ -12,82 +12,3 @@ alias heroku='nocorrect heroku'
alias ebuild='nocorrect ebuild'
alias hpodder='nocorrect hpodder'

alias be="bundle exec"
alias bi="bundle install"
alias bu="bundle update"

# Aliases
alias g='git'
compdef g=git
alias gst='git status'
compdef _git gst=git-status
alias gl='git pull'
compdef _git gl=git-pull
alias gup='git fetch && git rebase'
compdef _git gup=git-fetch
alias gp='git push'
compdef _git gp=git-push
gd() { git diff -w "$@" | view - }
compdef _git gd=git-diff
alias gc='git commit -v'
compdef _git gc=git-commit
alias gca='git commit -v -a'
compdef _git gca=git-commit
alias gco='git checkout'
compdef _git gco=git-checkout
alias gb='git branch'
compdef _git gb=git-branch
alias gba='git branch -a'
compdef _git gba=git-branch
alias gcount='git shortlog -sn'
compdef gcount=git
alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
alias glg='git log --stat --max-count=5'
compdef _git glg=git-log
alias ga='git add'
compdef _git ga='git-add'
alias gf='git fetch'
compdef _git gf='git-fetch'
alias gr='git remote -v'
compdef _git gr='git-remote'
alias gm='git merge'
compdef _git gm='git-merge'
alias gmu='git merge @{upstream}'


function _bundle_command {
if command -v bundle && [ -e "Gemfile" ]; then
bundle exec $@
else
$@
fi
}

function _rails_command () {
if [ -e "script/server" ]; then
ruby script/$@
else
ruby script/rails $@
fi
}

alias rc='_rails_command console'
alias rd='_rails_command destroy'
alias rdb='_rails_command dbconsole'
alias rdbm='rake db:migrate db:test:clone'
alias rg='_rails_command generate'
alias rp='_rails_command plugin'
alias rs='_rails_command server'
alias rsd='_rails_command server --debugger'
alias devlog='tail -f log/development.log'

alias rspec='_bundle_command rspec'
alias cuke='_bundle_command cucumber'

alias v='bundle exec vagrant'
compdef v=vagrant
alias vs='bundle exec vagrant ssh'
alias vu='bundle exec vagrant up'
alias vd='bundle exec vagrant destroy'
alias vp='bundle exec vagrant provision'
69 changes: 69 additions & 0 deletions zsh/06_git
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Git

function git-current-branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}

function git-track() {
remote=${1:-"origin"}
branch=$(git-current-branch)
git branch --set-upstream $branch $remote/$branch
}

function git-commits-behind() {
git rev-list --count --left-only @{upstream}...HEAD
}

function git-commits-ahead() {
git rev-list --count --right-only @{upstream}...HEAD
}

function git-can-ff() {
a="$(git rev-parse "$1")" &&
test "$(git merge-base "$a" "$2")" = "$a"
}

if [ "$commands[(I)hub]" ]; then
# eval `hub alias -s zsh`
function git(){hub "$@"}
fi

alias g='git'
compdef g=git
alias gst='git status'
compdef _git gst=git-status
alias gl='git pull'
compdef _git gl=git-pull
alias gup='git fetch && git rebase'
compdef _git gup=git-fetch
alias gp='git push'
compdef _git gp=git-push
gd() { git diff -w "$@" | view - }
compdef _git gd=git-diff
alias gc='git commit -v'
compdef _git gc=git-commit
alias gca='git commit -v -a'
compdef _git gca=git-commit
alias gco='git checkout'
compdef _git gco=git-checkout
alias gb='git branch'
compdef _git gb=git-branch
alias gba='git branch -a'
compdef _git gba=git-branch
alias gcount='git shortlog -sn'
compdef gcount=git
alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
alias glg='git log --stat --max-count=5'
compdef _git glg=git-log
alias ga='git add'
compdef _git ga='git-add'
alias gf='git fetch'
compdef _git gf='git-fetch'
alias gr='git remote -v'
compdef _git gr='git-remote'
alias gm='git merge'
compdef _git gm='git-merge'
alias gmu='git merge @{upstream}'

34 changes: 34 additions & 0 deletions zsh/06_ruby
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
alias be="bundle exec"
alias bi="bundle install"
alias bu="bundle update"

function _bundle_command {
if command -v bundle && [ -e "Gemfile" ]; then
bundle exec $@
else
$@
fi
}

function _rails_command () {
if [ -e "script/server" ]; then
ruby script/$@
else
ruby script/rails $@
fi
}


alias rc='_rails_command console'
alias rd='_rails_command destroy'
alias rdb='_rails_command dbconsole'
alias rdbm='rake db:migrate db:test:clone'
alias rg='_rails_command generate'
alias rp='_rails_command plugin'
alias rs='_rails_command server'
alias rsd='_rails_command server --debugger'
alias v='bundle exec vagrant'
alias vs='bundle exec vagrant ssh'
alias vu='bundle exec vagrant up'
alias vd='bundle exec vagrant destroy'
alias vp='bundle exec vagrant provision'
1 change: 0 additions & 1 deletion zsh/07_completion

This file was deleted.

65 changes: 0 additions & 65 deletions zsh/07_functions
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
function extract() {
unset REMOVE_ARCHIVE

if test "$1" = "-r"; then
REMOVE=1
shift
fi
if [[ -f $1 ]]; then
case $1 in
*.tar.bz2) tar xvjf $1;;
*.tar.gz) tar xvzf $1;;
*.tar.xz) tar xvJf $1;;
*.tar.lzma) tar --lzma -xvf $1;;
*.bz2) bunzip $1;;
*.rar) unrar $1;;
*.gz) gunzip $1;;
*.tar) tar xvf $1;;
*.tbz2) tar xvjf $1;;
*.tgz) tar xvzf $1;;
*.zip) unzip $1;;
*.Z) uncompress $1;;
*.7z) 7z x $1;;
*) echo "'$1' cannot be extracted via >extract<";;
esac

if [[ $REMOVE_ARCHIVE -eq 1 ]]; then
echo removing "$1";
/bin/rm "$1";
fi

else
echo "'$1' is not a valid file"
fi
}

function markdown() {
tmpfile=$(mktemp /tmp/markdown.XXXXXX)
cat $1 | markdown.pl > $tmpfile
Expand All @@ -50,36 +15,6 @@ function pow() {
fi
open http://$appname.dev
}

function git-current-branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}

function git-track() {
remote=${1:-"origin"}
branch=$(git-current-branch)
git branch --set-upstream $branch $remote/$branch
}

function git-commits-behind() {
git rev-list --count --left-only @{upstream}...HEAD
}

function git-commits-ahead() {
git rev-list --count --right-only @{upstream}...HEAD
}

function git-can-ff() {
a="$(git rev-parse "$1")" &&
test "$(git merge-base "$a" "$2")" = "$a"
}

if [ "$commands[(I)hub]" ]; then
# eval `hub alias -s zsh`
function git(){hub "$@"}
fi

function manp() {
man -t $* | ps2pdf - - | open -f -a Preview
}
Expand Down
Loading

0 comments on commit 1306b70

Please sign in to comment.