diff options
author | Fredrik Appelberg <fredrik.appelberg@gmail.com> | 2011-02-27 12:37:28 +0100 |
---|---|---|
committer | Fredrik Appelberg <fredrik.appelberg@gmail.com> | 2011-02-27 12:37:28 +0100 |
commit | d537dc8cb6907b4be520e8e603045aff37219e84 (patch) | |
tree | d87f6d6bc66c67c34982e433ece458289e8f2e22 /themes/nicoulaj.zsh-theme | |
parent | 63de788425d1d92e24f0214ceb21e35e277cc50f (diff) | |
parent | 746a10368acd38d80cd35c2b97202a9187d58a05 (diff) | |
download | zsh-d537dc8cb6907b4be520e8e603045aff37219e84.tar.gz zsh-d537dc8cb6907b4be520e8e603045aff37219e84.tar.bz2 zsh-d537dc8cb6907b4be520e8e603045aff37219e84.zip |
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'themes/nicoulaj.zsh-theme')
-rw-r--r-- | themes/nicoulaj.zsh-theme | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/themes/nicoulaj.zsh-theme b/themes/nicoulaj.zsh-theme new file mode 100644 index 000000000..333aa5e70 --- /dev/null +++ b/themes/nicoulaj.zsh-theme @@ -0,0 +1,43 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------ +# Prompt for the Zsh shell: +# * One line. +# * 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 +zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos. +zstyle ':vcs_info:*:*' unstagedstr '!' +zstyle ':vcs_info:*:*' stagedstr '+' +zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)" +zstyle ':vcs_info:*:*' formats "%S" "%r/%s/%b %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]%}" |