From 7c3af6980028caa2c204a3044ff217673c2eaab3 Mon Sep 17 00:00:00 2001 From: Lori Holden Date: Mon, 16 May 2011 10:33:46 -0600 Subject: [PATCH 1/2] Adding my Theme. :) --- themes/lholden.zsh-theme | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 themes/lholden.zsh-theme diff --git a/themes/lholden.zsh-theme b/themes/lholden.zsh-theme new file mode 100644 index 000000000..5a237d89a --- /dev/null +++ b/themes/lholden.zsh-theme @@ -0,0 +1,30 @@ +# ------------------------------------------------------------------------ +# Lori Holden oh-my-zsh theme +# Git and RVM information on the prompt +# ------------------------------------------------------------------------ + +function git_custom_branch() { + local cb=$(current_branch) + if [ -n "$cb" ]; then + echo "$ZSH_THEME_GIT_PROMPT_BRANCH_PREFIX${cb}$ZSH_THEME_GIT_PROMPT_BRANCH_SUFFIX" + fi +} + +function rvm_custom_prompt { + local rvmp=$(~/.rvm/bin/rvm-prompt i v g s 2> /dev/null) || return + echo "$ZSH_THEME_RVM_PROMPT_BRANCH_PREFIX${rvmp}$ZSH_THEME_RVM_PROMPT_BRANCH_SUFFIX" +} + +ZSH_THEME_RVM_PROMPT_BRANCH_PREFIX=" $reset_color$fg[magenta][" +ZSH_THEME_RVM_PROMPT_BRANCH_SUFFIX="]" +ZSH_THEME_GIT_PROMPT_BRANCH_PREFIX=" $reset_color$fg[magenta][" +ZSH_THEME_GIT_PROMPT_BRANCH_SUFFIX="" +ZSH_THEME_GIT_PROMPT_SHA_BEFORE="@" +ZSH_THEME_GIT_PROMPT_SHA_AFTER="]" +ZSH_THEME_GIT_PROMPT_DIRTY="$reset_color$fg_bold[red]*" +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_AHEAD="$reset_color$fg_bold[red]!" + +# Prompt format +PROMPT='( $fg[white]%n@%m$fg[white]:$(parse_git_dirty)$(git_prompt_ahead)$reset_color$fg_bold[blue]%~%u$(git_custom_branch)$(git_prompt_short_sha)$(rvm_custom_prompt)$reset_color ) +$fg_bold[blue]%%$reset_color ' From b6182e923fb75bdf2f059c849eb56d5473735134 Mon Sep 17 00:00:00 2001 From: Lori Holden Date: Mon, 16 May 2011 10:55:29 -0600 Subject: [PATCH 2/2] Fix cursor issues --- themes/lholden.zsh-theme | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/lholden.zsh-theme b/themes/lholden.zsh-theme index 5a237d89a..16e23d14c 100644 --- a/themes/lholden.zsh-theme +++ b/themes/lholden.zsh-theme @@ -15,16 +15,16 @@ function rvm_custom_prompt { echo "$ZSH_THEME_RVM_PROMPT_BRANCH_PREFIX${rvmp}$ZSH_THEME_RVM_PROMPT_BRANCH_SUFFIX" } -ZSH_THEME_RVM_PROMPT_BRANCH_PREFIX=" $reset_color$fg[magenta][" +ZSH_THEME_RVM_PROMPT_BRANCH_PREFIX=" %{$reset_color%}%{$fg[magenta]%}[" ZSH_THEME_RVM_PROMPT_BRANCH_SUFFIX="]" -ZSH_THEME_GIT_PROMPT_BRANCH_PREFIX=" $reset_color$fg[magenta][" +ZSH_THEME_GIT_PROMPT_BRANCH_PREFIX=" %{$reset_color%{$fg[magenta]%}[" ZSH_THEME_GIT_PROMPT_BRANCH_SUFFIX="" ZSH_THEME_GIT_PROMPT_SHA_BEFORE="@" ZSH_THEME_GIT_PROMPT_SHA_AFTER="]" -ZSH_THEME_GIT_PROMPT_DIRTY="$reset_color$fg_bold[red]*" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}%{$fg_bold[red]%}*" ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_AHEAD="$reset_color$fg_bold[red]!" +ZSH_THEME_GIT_PROMPT_AHEAD="$reset_color%}%{$fg_bold[red]%}!" # Prompt format -PROMPT='( $fg[white]%n@%m$fg[white]:$(parse_git_dirty)$(git_prompt_ahead)$reset_color$fg_bold[blue]%~%u$(git_custom_branch)$(git_prompt_short_sha)$(rvm_custom_prompt)$reset_color ) -$fg_bold[blue]%%$reset_color ' +PROMPT='( %{$fg[white%}]%n@%m%{$fg[white]%}:$(parse_git_dirty)$(git_prompt_ahead)%{$reset_color%}%{$fg_bold[blue]%}%~%u$(git_custom_branch)$(git_prompt_short_sha)$(rvm_custom_prompt)%{$reset_color%} ) +%{$fg_bold[blue]%}%%%{$reset_color%} '