diff --git a/shell/zsh/custom/plain.zsh-theme b/shell/zsh/custom/plain.zsh-theme new file mode 100644 index 0000000..52c4de3 --- /dev/null +++ b/shell/zsh/custom/plain.zsh-theme @@ -0,0 +1,23 @@ +PROMPT='%n@%m %~$(check_git_prompt_info)$ %{$reset_color%}' + +local return_code="%(?..%{$fg[cyan]%}%? ↵%{$reset_color%})" +RPROMPT="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[cyan]%})%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$fg[blue]%}" + + +# 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. -- Brorrowed from Soliah.zsh-theme :) +function check_git_prompt_info() { + if git rev-parse --git-dir > /dev/null 2>&1; then + if [[ -z $(git_prompt_info) ]]; then + echo " %{$fg[cyan]%}(detached%{$fg[magenta]%}*%{$fg[cyan]%})%{$reset_color%}" + else + echo " $(git_prompt_info)" + fi + fi +} diff --git a/shell/zsh/oh-my-zsh b/shell/zsh/oh-my-zsh index 45c6a3a..f9018c5 160000 --- a/shell/zsh/oh-my-zsh +++ b/shell/zsh/oh-my-zsh @@ -1 +1 @@ -Subproject commit 45c6a3aba4e37a81e011109eb2535aae02d2b0df +Subproject commit f9018c5efbb6cf164139009eff1863837d72b412 diff --git a/shell/zshrc.sh b/shell/zshrc.sh index 543d1ac..9502db8 100644 --- a/shell/zshrc.sh +++ b/shell/zshrc.sh @@ -8,6 +8,9 @@ DOTZSH="$DOTSHELL/zsh" # Path to your oh-my-zsh configuration. ZSH="$DOTZSH/oh-my-zsh" +# Customize oh-my-zsh's custom path. +ZSH_CUSTOM="$DOTZSH/custom" + # Set name of the theme to load. # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each @@ -31,7 +34,8 @@ DISABLE_AUTO_TITLE="true" # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) -plugins=(cap brew bundler gem heroku osx thor vagrant ruby rails3 powder python cake node) +plugins=(brew bundler cake cap gem heroku node nyan osx powder python rails3 \ + rbenv ruby thor vagrant) source "$ZSH/oh-my-zsh.sh" @@ -40,8 +44,10 @@ source "$ZSH/oh-my-zsh.sh" # Disable shared history unsetopt share_history -# Disable bundled heroku binary, I install the gem globally +# Disable certain bundled ruby binaries, I install the gems globally. +unalias foreman unalias heroku +unalias shotgun # Cause I hit emacs shorts too much bindkey -s "\C-x\C-f" "cd "