From 2759884ec71bd9f5872e27d104da6cff163f28aa Mon Sep 17 00:00:00 2001 From: Hauke Schade Date: Mon, 24 Sep 2012 17:03:46 +0200 Subject: [PATCH] added my own theme, which is pretty much based on nicoulaj's theme --- themes/cnlpete.zsh-theme | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 themes/cnlpete.zsh-theme diff --git a/themes/cnlpete.zsh-theme b/themes/cnlpete.zsh-theme new file mode 100644 index 000000000..71a5544ca --- /dev/null +++ b/themes/cnlpete.zsh-theme @@ -0,0 +1,44 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------ +# Prompt for the Zsh shell: +# * One line. +# * short VCS info on the right prompt. +# * Only shows the path on the left prompt by default. +# * Crops the path to a defined length and only shows the path relative to +# the current VCS repository root. +# * Wears a different color wether the last command succeeded/failed. +# * Shows user@hostname if connected through SSH. +# * Shows if logged in as root or not. +# ------------------------------------------------------------------------------ + +# Customizable parameters. +PROMPT_PATH_MAX_LENGTH=30 +PROMPT_DEFAULT_END=' >' +PROMPT_ROOT_END=' >>>' +PROMPT_SUCCESS_COLOR=$FG[071] +PROMPT_FAILURE_COLOR=$FG[124] +PROMPT_VCS_INFO_COLOR=$FG[242] + +# Set required options. +setopt promptsubst + +# Load required modules. +autoload -U add-zsh-hook +autoload -Uz vcs_info + +# Add hook for calling vcs_info before each command. +add-zsh-hook precmd vcs_info + +# Set vcs_info parameters. +zstyle ':vcs_info:*' enable hg bzr git svn +# check-for-changes can be slow on big repos. +zstyle ':vcs_info:(hg*|git*|bzr*):*' check-for-changes true +zstyle ':vcs_info:*:*' unstagedstr '*' +zstyle ':vcs_info:*:*' stagedstr '+' +zstyle ':vcs_info:*:*' actionformats "%r:%S (%a)" "%b %{$fg_bold[red]%}%u%c" +zstyle ':vcs_info:*:*' formats "%r:%S" "%b %{$fg_bold[red]%}%u%c" +zstyle ':vcs_info:*:*' nvcsformats "%~" "" + +# Define prompts. +PROMPT="%(0?.%{$PROMPT_SUCCESS_COLOR%}.%{$PROMPT_FAILURE_COLOR%})${SSH_TTY:+[%n@%m]}%{$FX[bold]%}%$PROMPT_PATH_MAX_LENGTH<..<"'${vcs_info_msg_0_%%.}'"%<<%(!.$PROMPT_ROOT_END.$PROMPT_DEFAULT_END)%{$FX[no-bold]%}%{$FX[reset]%} " +RPROMPT="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}"