From f468fadc24636ea393ea1c62603ccaa90319a1d2 Mon Sep 17 00:00:00 2001 From: Christoph Neuroth Date: Thu, 22 Dec 2011 09:02:05 +0100 Subject: [PATCH 1/3] add c089 theme based on modified prose, see url on top, modified to include the history number in the prompt --- themes/c089.zsh-theme | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 themes/c089.zsh-theme diff --git a/themes/c089.zsh-theme b/themes/c089.zsh-theme new file mode 100644 index 000000000..a001a45c2 --- /dev/null +++ b/themes/c089.zsh-theme @@ -0,0 +1,21 @@ +# from http://blog.munge.net/2011/10/fun-with-zsh-themes/ +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +function vcprompt_info { + vcprompt --format-git "on ± %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%a%{$reset_color%}" \ + --format-hg "on ☿ %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%{$reset_color%}" \ + --format "on %s %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%{$reset_color%}" +} + +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname -s +} + +setopt PROMPTBANG +PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(vcprompt_info) +$(virtualenv_info)${fg_bold[white]}[!!!%(?,,%{%}:%?)]%{$reset_color%} %# ' + +local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" +RPROMPT='${return_status}%{$reset_color%}' From ea671f0544bbbe21f1b4aa829330a35040d7dc63 Mon Sep 17 00:00:00 2001 From: Christoph Neuroth Date: Thu, 5 Jan 2012 10:09:24 +0100 Subject: [PATCH 2/3] remove vcprompt (it was too sluggish with big mercurial repos) --- themes/c089.zsh-theme | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/c089.zsh-theme b/themes/c089.zsh-theme index a001a45c2..f3849cc06 100644 --- a/themes/c089.zsh-theme +++ b/themes/c089.zsh-theme @@ -3,10 +3,12 @@ function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' } +# TODO: Currently not used because it renders the prompt unusably slow in large +# hg directories. Could not find a way to disable it only for mercurial though. function vcprompt_info { vcprompt --format-git "on ± %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%a%{$reset_color%}" \ - --format-hg "on ☿ %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%{$reset_color%}" \ --format "on %s %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%{$reset_color%}" + --format-hg "on ☿ %{$fg[magenta]%}%b%{$reset_color%}%{$fg[green]%}%u%m%{$reset_color%}" \ } function box_name { @@ -14,7 +16,7 @@ function box_name { } setopt PROMPTBANG -PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(vcprompt_info) +PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%} $(virtualenv_info)${fg_bold[white]}[!!!%(?,,%{%}:%?)]%{$reset_color%} %# ' local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" From ccf13440d827a793afb801dad818e13f79a7d766 Mon Sep 17 00:00:00 2001 From: Christoph Neuroth Date: Thu, 5 Jan 2012 10:14:31 +0100 Subject: [PATCH 3/3] new mercurial alias hgup hgup shows incoming changes (hg in) before pulling them (pull -u) --- plugins/mercurial/mercurial.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index 2988f0a46..fbfa5c0b6 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -7,6 +7,8 @@ alias hgco='hg checkout' alias hgd='hg diff' alias hged='hg diffmerge' # pull and update +# show incoming commits with log msg, pull them in if there are any and update +alias hgup='hg in && hg pull -u -v' alias hgl='hg pull -u -v' alias hgp='hg push -v' alias hgs='hg status -v'