From 62364c57e268a27ac3cccdbd00d71defccf1b186 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 31 Oct 2011 11:36:04 +0000 Subject: [PATCH 1/3] added plain theme --- themes/plain.zsh-theme | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 themes/plain.zsh-theme diff --git a/themes/plain.zsh-theme b/themes/plain.zsh-theme new file mode 100644 index 000000000..4c1430ec1 --- /dev/null +++ b/themes/plain.zsh-theme @@ -0,0 +1,23 @@ +PROMPT='%n@%m %~$(check_git_prompt_info)$ %{$reset_color%}' + +local return_code="%(?..%{$fg[magenta]%}%? ↵%{$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]%}*%{$reset_color%}%{$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 +} From 6d7bcef52a6c97078c5dabd3985a90d7ec2178c2 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 31 Oct 2011 11:46:54 +0000 Subject: [PATCH 2/3] changed return code color from magenta to cyan --- themes/plain.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/plain.zsh-theme b/themes/plain.zsh-theme index 4c1430ec1..a8d67322b 100644 --- a/themes/plain.zsh-theme +++ b/themes/plain.zsh-theme @@ -1,6 +1,6 @@ PROMPT='%n@%m %~$(check_git_prompt_info)$ %{$reset_color%}' -local return_code="%(?..%{$fg[magenta]%}%? ↵%{$reset_color%})" +local return_code="%(?..%{$fg[cyan]%}%? ↵%{$reset_color%})" RPROMPT="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}(" From 5bde29b4571b75f271ee5288bf8950d313afc291 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 31 Oct 2011 12:25:42 +0000 Subject: [PATCH 3/3] removed useless reset_color call --- themes/plain.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/plain.zsh-theme b/themes/plain.zsh-theme index a8d67322b..52c4de32b 100644 --- a/themes/plain.zsh-theme +++ b/themes/plain.zsh-theme @@ -5,7 +5,7 @@ RPROMPT="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}(" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}%{$fg[cyan]%})%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[cyan]%})%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$fg[blue]%}"