From 38062cb5d68ce764c8272ed3b4887bcef9fc245b Mon Sep 17 00:00:00 2001 From: Daniel YC Lin Date: Tue, 6 Aug 2013 18:40:44 +0800 Subject: [PATCH] use highlight color as prompt. --- themes/dlintw.zsh-theme | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 themes/dlintw.zsh-theme diff --git a/themes/dlintw.zsh-theme b/themes/dlintw.zsh-theme new file mode 100644 index 000000000..a2297a363 --- /dev/null +++ b/themes/dlintw.zsh-theme @@ -0,0 +1,20 @@ +# Based on cypher and 's prompt http://blog.mired.org/2011/02/adding-vcs-to-zshs-vcsinfo.html +# @author Daniel YC Lin +# Shows the exit status of the last command if non-zero +# Uses "#" instead of "ยป" when running with elevated privileges +PROMPT="%{$fg_bold[green]%}%D{%H:%M:%S}%(0?. . ${fg[red]}%? )%{${fg[blue]}%}$%{${reset_color}%} " + +autoload -Uz vcs_info +precmd () { vcs_info } + +zstyle ':vcs_info:*' get-revision true +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' formats '%u%c|%s:%b' +zstyle ':vcs_info:*' actionformats '%c%u|%s@%a:%b' +zstyle ':vcs_info:*' branchformat '%b@%r' +zstyle ':vcs_info:*' unstagedstr "%{$fg_no_bold[red]%}" +zstyle ':vcs_info:*' stagedstr "%{$fg_no_bold[yellow]%}" +zstyle ':vcs_info:*' enable fossil hg svn git cvs # p4 off, but must be last. + +RPROMPT='%n@%m %{$fg_no_bold[magenta]%}%3~%{$fg_no_bold[green]%}${vcs_info_msg_0_}%{$reset_color%}' +setopt PROMPT_SUBST