From 940c1f5ce816c6ee9d1a1c4cab20733be4334825 Mon Sep 17 00:00:00 2001 From: Davide Date: Tue, 27 Sep 2011 20:13:49 +0200 Subject: [PATCH 1/4] removed function in_svn, replaced with direct call to -d --- plugins/svn/svn.plugin.zsh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 53a8a513a..6fd862815 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,19 +1,12 @@ function svn_prompt_info { - if [ in_svn ]; then + if [[ -d .svn ]]; then echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" fi } - -function in_svn() { - if [[ -d .svn ]]; then - echo 1 - fi -} - function svn_get_repo_name { - if [ in_svn ]; then + if [[ -d .svn ]]; then svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" @@ -21,13 +14,13 @@ function svn_get_repo_name { } function svn_get_rev_nr { - if [ in_svn ]; then + if [[ -d .svn ]]; then svn info 2> /dev/null | sed -n s/Revision:\ //p fi } function svn_dirty_choose { - if [ in_svn ]; then + if [[ -d .svn ]]; then s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null) if [ $s ]; then echo $1 From 3725adb2be2fd04664369419315afcd439dff920 Mon Sep 17 00:00:00 2001 From: Davide Date: Tue, 27 Sep 2011 21:22:10 +0200 Subject: [PATCH 2/4] Added tucano theme --- themes/tucano.zsh-theme | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 themes/tucano.zsh-theme diff --git a/themes/tucano.zsh-theme b/themes/tucano.zsh-theme new file mode 100644 index 000000000..c23e06d62 --- /dev/null +++ b/themes/tucano.zsh-theme @@ -0,0 +1,28 @@ +########################################################## +# _ +# | |_ _ _ __ __ _ _ _ ___ +# | _| || / _/ _` | ' \/ _ \ +# \__|\_,_\__\__,_|_||_\___/ +# +# zsh-theme +# +########################################################## + +# the git plugin has to be activated for this to work. + +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%} %m:%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}%# ' + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " + +# the svn plugin has to be activated for this to work. + +ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" +ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" + +ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" +ZSH_THEME_SVN_PROMPT_SUFFIX=")" +ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" +ZSH_THEME_SVN_PROMPT_CLEAN=" " \ No newline at end of file From 8b90efa232a1f32cfb4186a7d8f522022698b602 Mon Sep 17 00:00:00 2001 From: Davide Date: Wed, 28 Sep 2011 15:16:51 +0200 Subject: [PATCH 3/4] tucanosmall template --- themes/tucanosmall.zsh-theme | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 themes/tucanosmall.zsh-theme diff --git a/themes/tucanosmall.zsh-theme b/themes/tucanosmall.zsh-theme new file mode 100644 index 000000000..58ed3fcd4 --- /dev/null +++ b/themes/tucanosmall.zsh-theme @@ -0,0 +1,28 @@ +########################################################## +# _ +# | |_ _ _ __ __ _ _ _ ___ +# | _| || / _/ _` | ' \/ _ \ +# \__|\_,_\__\__,_|_||_\___/ +# +# zsh-theme (small) +# +########################################################## + +# the git plugin has to be activated for this to work. + +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%} %p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}%# ' + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " + +# the svn plugin has to be activated for this to work. + +ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" +ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" + +ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" +ZSH_THEME_SVN_PROMPT_SUFFIX=")" +ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" +ZSH_THEME_SVN_PROMPT_CLEAN=" " \ No newline at end of file From 727848f9b6da0f1e90af146c228a90529080f596 Mon Sep 17 00:00:00 2001 From: Davide Date: Tue, 11 Oct 2011 11:49:44 +0200 Subject: [PATCH 4/4] refix svn --- plugins/svn/svn.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 53a8a513a..e2cf96ca3 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,5 +1,5 @@ function svn_prompt_info { - if [ in_svn ]; then + if [ $(in_svn) ]; then echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" fi @@ -13,7 +13,7 @@ function in_svn() { } function svn_get_repo_name { - if [ in_svn ]; then + if [ $(in_svn) ]; then svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" @@ -21,13 +21,13 @@ function svn_get_repo_name { } function svn_get_rev_nr { - if [ in_svn ]; then + if [ $(in_svn) ]; then svn info 2> /dev/null | sed -n s/Revision:\ //p fi } function svn_dirty_choose { - if [ in_svn ]; then + if [ $(in_svn) ]; then s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null) if [ $s ]; then echo $1