Update tmux and zsh for git

This commit is contained in:
Hunter Haugen 2014-03-11 14:10:51 -07:00
parent 98ede8b9f7
commit 1d74e0cf43
3 changed files with 42 additions and 269 deletions

56
.zshenv
View file

@ -11,15 +11,21 @@ fpath=($fpath $HOME/.zsh/func)
#typeset -u fpath
# Options
setopt appendhistory hist_ignore_space hist_ignore_all_dups extendedglob nomatch notify dvorak # correct
setopt prompt_subst appendhistory hist_ignore_space hist_ignore_all_dups extendedglob nomatch notify dvorak # correct
unsetopt beep
bindkey -e
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit colors zgitinit && colors && zgitinit
autoload -Uz compinit colors vcs_info select-word-style && colors
compinit -u
zstyle :compinstall filename '~/.zshenv'
zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
zstyle ':vcs_info:*' enable git
#bindkey '^L' push-line
bindkey "^I" expand-or-complete-prefix
#select-word-style bash
umask 022
# Fix $TERM
@ -97,23 +103,29 @@ export ENVPUPPET_BASEDIR="$HOME/Documents/work/git"
export OVFTOOL='/Applications/VMware OVF Tool/ovftool'
# Prompt
#PS1="%m%# "
prompt_precmd() {
gitcolor=""
if zgit_isgit ; then
if ! zgit_isindexclean ; then
#PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f](%F{cyan}$(zgit_branch)%f)>"
gitcolor=$fg[blue]
elif ! zgit_isworktreeclean ; then
#PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f]>"
gitcolor=$fg[green]
fi
fi
color="%(?.$gitcolor.$fg[red])"
PROMPT="%m$color%#%{$reset_color%} "
}
#prompt_precmd() {
# gitcolor=""
# if zgit_isgit ; then
# if ! zgit_isindexclean ; then
# #PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f](%F{cyan}$(zgit_branch)%f)>"
# gitcolor=$fg[blue]
# elif ! zgit_isworktreeclean ; then
# #PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f]>"
# gitcolor=$fg[green]
# fi
# fi
# color="%(?.$gitcolor.$fg[red])"
# PROMPT="%m$color%#%{$reset_color%} "
#}
#precmd_functions+=prompt_precmd
PROMPT="%m%# "
vcs_info_wrapper() {
vcs_info
if [ -n "$vcs_info_msg_0_" ]; then
echo "%{$fg[grey]%}${vcs_info_msg_0_}%{$reset_color%}$del"
fi
}
RPROMPT=$'$(vcs_info_wrapper)'
if [ `uname -s` = "SunOS" ] ; then
export LANG="C"
@ -244,14 +256,14 @@ alias gd="git diff"
alias gdc="git diff --cached"
alias gc="git commit"
alias gca="git commit --amend"
alias gfa="git fetch --all"
alias gfap="git fetch --all --prune"
alias gfa="git fetch --all --prune"
alias gr="git remote -v show"
alias gp="git push"
alias gu="git pull"
alias gdw="git diff --color-words"
alias gk="gitk --all&"
alias gx="gitx --all"
alias be="bundle exec"
alias uzbl="uzbl-browser"
alias hide="SetFile -a V"
alias show="SetFile -a v"
@ -264,6 +276,10 @@ alias -s mkv="mplayer"
alias -s mpg="mplayer"
# Functions
function listvm() { curl -s --url http://vcloud.delivery.puppetlabs.net/vm/ ; }
function getvm() { curl -d --url http://vcloud.delivery.puppetlabs.net/vm/$1 ; }
function sshvm() { ssh -i ~/.ssh/id_rsa-acceptance root@$1 ; }
function rmvm() { curl -X DELETE --url http://vcloud.delivery.puppetlabs.net/vm/$1 ; }
args() { echo $#; }
title() { WINTITLE="$*"; print -Pn "\e]0;$WINTITLE\a" }
hl() { pbpaste | highlight --syntax=$1 -O rtf | pbcopy }