Merge git://github.com/sjl/oh-my-zsh into sjl

This commit is contained in:
Matt Cable 2010-02-02 10:30:15 -07:00
commit f0d9edcbb9
7 changed files with 57 additions and 6 deletions

5
.gitignore vendored
View file

@ -1,5 +1,8 @@
locals.zsh
log/.zsh_history
projects.zsh
custom
custom/*.zsh
!custom/example.zsh
!custom/example.zsh
.DS_Store

View file

@ -4,6 +4,9 @@ setopt auto_pushd
setopt pushd_ignore_dups
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias cd..='cd ..'
alias cd...='cd ../..'
alias cd....='cd ../../..'

View file

@ -44,7 +44,7 @@ function tab() {
end
tell application "Terminal"
activate
do script with command "cd \"$PWD\"; $*" in window 1
do script with command "cd \"$PWD\"; clear; $*" in window 1
end tell
EOF
}

View file

@ -5,10 +5,18 @@ function git_prompt_info() {
}
parse_git_dirty () {
if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)')
if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then
echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY"
fi
if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\)$") > 0 ]]; then
echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED"
fi
if [[ $(echo ${gitstat} | wc -l | tr -d ' ') == 0 ]]; then
echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
}

View file

@ -3,6 +3,7 @@ autoload -U url-quote-magic
zle -N self-insert url-quote-magic
## file rename magick
autoload -U zmv
bindkey "^[m" copy-prev-shell-word
## jobs

3
lib/python.zsh Normal file
View file

@ -0,0 +1,3 @@
function wo() {
[ -f './.venv' ] && workon `cat ./.venv`
}

33
themes/prose.zsh-theme Normal file
View file

@ -0,0 +1,33 @@
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
function battery_charge {
echo `$BAT_CHARGE` 2>/dev/null
}
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
function hg_prompt_info {
hg prompt --angle-brackets "\
< on %{$fg[magenta]%}<branch>%{$reset_color%}>\
< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
}
PROMPT='
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
$(virtualenv_info)$(prompt_char) '
RPROMPT='$(battery_charge)'
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""