Merged pull request #288 from dogenpunk/dogenpunk_theme.

Adding dogenpunk theme
This commit is contained in:
Robby Russell 2011-04-26 09:48:49 -07:00
commit d7ec387b8f
17 changed files with 206 additions and 26 deletions

View File

@ -54,12 +54,6 @@ h3. Uninstalling
If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config). If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
h2. Thanks
* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
* Marcel (noradio) provided Rick the original zsh configuration.
* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh.
h2. Help out! h2. Help out!
I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
@ -67,3 +61,11 @@ I'm far from being a zsh-expert and suspect there are many ways to improve. If y
h3. Send us your theme! h3. Send us your theme!
I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
h2. Contributors
This project wouldn't exist without all of our awesome users and contributors.
* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
Thank you so much!

View File

@ -4,7 +4,6 @@ unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol unsetopt flowcontrol
setopt auto_menu # show completion menu on succesive tab press setopt auto_menu # show completion menu on succesive tab press
setopt complete_in_word setopt complete_in_word
setopt complete_aliases
setopt always_to_end setopt always_to_end
WORDCHARS='' WORDCHARS=''

View File

@ -3,11 +3,12 @@
#Fully support screen, iterm, and probably most modern xterm and rxvt #Fully support screen, iterm, and probably most modern xterm and rxvt
#Limited support for Apple Terminal (Terminal can't set window or tab separately) #Limited support for Apple Terminal (Terminal can't set window or tab separately)
function title { function title {
if [[ "$TERM" == "screen" ]]; then [ "$DISABLE_AUTO_TITLE" != "true" ] || return
print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars if [[ $TERM =~ "^screen" ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2\a" #set window name print -Pn "\e]2;$2:q\a" #set window name
print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal) print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
fi fi
} }
@ -21,6 +22,8 @@ function precmd {
#Appears at the beginning of (and during) of command execution #Appears at the beginning of (and during) of command execution
function preexec { function preexec {
emulate -L zsh
setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
title "$CMD" "%100>...>$2%<<" title "$CMD" "%100>...>$2%<<"
} }

View File

@ -31,6 +31,7 @@ _1st_arguments=(
'search:search for a formula (/regex/ or string)' 'search:search for a formula (/regex/ or string)'
'unlink:unlink a formula' 'unlink:unlink a formula'
'update:freshen up links' 'update:freshen up links'
'upgrade:upgrade outdated formulae'
'uses:show formulas which depend on a formula' 'uses:show formulas which depend on a formula'
) )

View File

@ -1,22 +1,36 @@
# Aliases # Aliases
alias g='git' alias g='git'
compdef g=git
alias gst='git status' alias gst='git status'
compdef _git gst=git-status
alias gl='git pull' alias gl='git pull'
compdef _git gl=git-pull
alias gup='git fetch && git rebase' alias gup='git fetch && git rebase'
compdef _git gup=git-fetch
alias gp='git push' alias gp='git push'
alias gd='git diff | mate' compdef _git gp=git-push
alias gdv='git diff -w "$@" | vim -R -' gdv() { git-diff -w "$@" | view - }
compdef _git gdv=git-diff
alias gc='git commit -v' alias gc='git commit -v'
compdef _git gc=git-commit
alias gca='git commit -v -a' alias gca='git commit -v -a'
compdef _git gca=git-commit
alias gco='git checkout' alias gco='git checkout'
compdef _git gco=git-checkout
alias gb='git branch' alias gb='git branch'
compdef _git gb=git-branch
alias gba='git branch -a' alias gba='git branch -a'
compdef _git gba=git-branch
alias gcount='git shortlog -sn' alias gcount='git shortlog -sn'
compdef gcount=git
alias gcp='git cherry-pick' alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
alias glg='git log --stat --max-count=5' alias glg='git log --stat --max-count=5'
compdef _git glg=git-log
# Git and svn mix # Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
compdef git-svn-dcommit-push=git
# #
# Will return the current branch name # Will return the current branch name
@ -29,5 +43,8 @@ function current_branch() {
# these aliases take advantage of the previous function # these aliases take advantage of the previous function
alias ggpull='git pull origin $(current_branch)' alias ggpull='git pull origin $(current_branch)'
compdef ggpull=git
alias ggpush='git push origin $(current_branch)' alias ggpush='git push origin $(current_branch)'
compdef ggpush=git
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
compdef ggpnp=git

View File

@ -1,3 +1,10 @@
# hub alias from defunkt
# https://github.com/defunkt/hub
if [ "$commands[(I)hub]" ]; then
# eval `hub alias -s zsh`
function git(){hub "$@"}
fi
# add github completion function to path # add github completion function to path
fpath=($ZSH/plugins/github $fpath) fpath=($ZSH/plugins/github $fpath)
autoload -U compinit autoload -U compinit

View File

@ -0,0 +1,8 @@
# commands to control local mysql-server installation
# paths are for osx installation via macports
alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start'
alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop'
alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart'
alias mysqlstatus='mysqladmin5 -u root -p ping'

View File

@ -1,6 +0,0 @@
# commands to control local mysql-server installation
# paths are for osx installtion via macports
alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
alias mysqlstatus='mysqladmin5 -u root -p ping'

19
plugins/npm/_npm Normal file
View File

@ -0,0 +1,19 @@
#compdef npm
# Node Package Manager 0.3.15 completion, letting npm do all the completion work
_npm() {
compadd -- $(_npm_complete $words)
}
# We want to show all errors of any substance, but never the "npm (not )ok" one.
# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.)
_npm_complete() {
local ask_npm
ask_npm=(npm completion --color false --loglevel error -- $@)
{ _call_program npm $ask_npm 2>&1 >&3 \
| egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \
} 3>&1
}
_npm "$@"

View File

@ -0,0 +1,4 @@
# add npm completion function to path
fpath=($ZSH/plugins/npm $fpath)
autoload -U compinit
compinit -i

View File

@ -14,6 +14,9 @@ export ZSH_THEME="robbyrussell"
# Uncomment following line if you want to disable colors in ls # Uncomment following line if you want to disable colors in ls
# export DISABLE_LS_COLORS="true" # export DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# export DISABLE_AUTO_TITLE="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git) plugins=(git)

View File

@ -1,4 +1,4 @@
PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(git_prompt_info) PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info)
$ ' $ '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
@ -16,6 +16,29 @@ ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
# Git sometimes goes into a detached head state. git_prompt_info doesn't
# return anything in this case. So wrap it in another function and check
# for an empty string.
function check_git_prompt_info() {
if git rev-parse --git-dir > /dev/null 2>&1; then
if [[ -z $(git_prompt_info) ]]; then
echo "%{$fg[magenta]%}detached-head%{$reset_color%})"
else
echo "$(git_prompt_info)"
fi
fi
}
# Determine if we are using a gemset.
function rvm_gemset() {
GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
if [[ -n $GEMSET ]]; then
echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
fi
}
# Determine the time since last commit. If branch is clean, # Determine the time since last commit. If branch is clean,
# use a neutral color, otherwise colors will vary according to time. # use a neutral color, otherwise colors will vary according to time.
function git_time_since_commit() { function git_time_since_commit() {
@ -49,15 +72,15 @@ function git_time_since_commit() {
fi fi
if [ "$HOURS" -gt 24 ]; then if [ "$HOURS" -gt 24 ]; then
echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
elif [ "$MINUTES" -gt 60 ]; then elif [ "$MINUTES" -gt 60 ]; then
echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
else else
echo "($COLOR${MINUTES}m%{$reset_color%}|" echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|"
fi fi
else else
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
echo "($COLOR~|" echo "($(rvm_gemset)$COLOR~|"
fi fi
fi fi
} }

10
themes/frisk.zsh-theme Normal file
View File

@ -0,0 +1,10 @@
PROMPT=$'
%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%}
%{$fg_bold[black]%}>%{$reset_color%} '
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""

19
themes/gallois.zsh-theme Normal file
View File

@ -0,0 +1,19 @@
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
local cb=$(current_branch)
if [ -n "$cb" ]; then
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
#RVM and git settings
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
fi
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '

21
themes/kolo.zsh-theme Normal file
View File

@ -0,0 +1,21 @@
autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
zstyle ':vcs_info:*' enable git svn
precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
} else {
zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
}
vcs_info
}
setopt prompt_subst
PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '

50
themes/kphoen.zsh-theme Normal file
View File

@ -0,0 +1,50 @@
# ------------------------------------------------------------------------------
# FILE: kphoen.zsh-theme
# DESCRIPTION: oh-my-zsh theme file.
# AUTHOR: Kévin Gomez (geek63@gmail.com)
# VERSION: 1.0.0
# SCREENSHOT:
# ------------------------------------------------------------------------------
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)]
%# '
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
# display exitcode on the right when >0
return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
else
PROMPT='[%n@%m:%~$(git_prompt_info)]
%# '
ZSH_THEME_GIT_PROMPT_PREFIX=" on"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
# display exitcode on the right when >0
return_code="%(?..%? ↵)"
RPROMPT='${return_code}$(git_prompt_status)'
ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
ZSH_THEME_GIT_PROMPT_DELETED=" ✖"
ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭"
fi

View File

@ -5,7 +5,7 @@ then
fi fi
echo "Cloning Oh My Zsh..." echo "Cloning Oh My Zsh..."
/usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
echo "Looking for an existing zsh config..." echo "Looking for an existing zsh config..."
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
@ -22,7 +22,7 @@ echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
echo "export PATH=$PATH" >> ~/.zshrc echo "export PATH=$PATH" >> ~/.zshrc
echo "Time to change your default shell to zsh!" echo "Time to change your default shell to zsh!"
chsh -s "/usr/bin/env zsh" chsh -s `which zsh`
echo ' __ __ ' echo ' __ __ '
echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '