]>
git.rmz.io Git - dotfiles.git/blob - zsh/themes/nicoulaj.zsh-theme
333aa5e702e65256e0a73e0cef28effe65448964
   2 # ------------------------------------------------------------------------------ 
   3 # Prompt for the Zsh shell: 
   5 #   * VCS info on the right prompt. 
   6 #   * Only shows the path on the left prompt by default. 
   7 #   * Crops the path to a defined length and only shows the path relative to 
   8 #     the current VCS repository root. 
   9 #   * Wears a different color wether the last command succeeded/failed. 
  10 #   * Shows user@hostname if connected through SSH. 
  11 #   * Shows if logged in as root or not. 
  12 # ------------------------------------------------------------------------------ 
  14 # Customizable parameters. 
  15 PROMPT_PATH_MAX_LENGTH
=30 
  18 PROMPT_SUCCESS_COLOR
=$FG[071] 
  19 PROMPT_FAILURE_COLOR
=$FG[124] 
  20 PROMPT_VCS_INFO_COLOR
=$FG[242] 
  22 # Set required options. 
  25 # Load required modules. 
  26 autoload 
-U add
-zsh-hook 
  29 # Add hook for calling vcs_info before each command. 
  30 add
-zsh-hook precmd vcs_info
 
  32 # Set vcs_info parameters. 
  33 zstyle 
':vcs_info:*' enable hg bzr git
 
  34 zstyle 
':vcs_info:*:*' check
-for-changes true 
# Can be slow on big repos. 
  35 zstyle 
':vcs_info:*:*' unstagedstr 
'!' 
  36 zstyle 
':vcs_info:*:*' stagedstr 
'+' 
  37 zstyle 
':vcs_info:*:*' actionformats 
"%S" "%r/%s/%b %u%c (%a)" 
  38 zstyle 
':vcs_info:*:*' formats 
"%S" "%r/%s/%b %u%c" 
  39 zstyle 
':vcs_info:*:*' nvcsformats 
"%~" "" 
  42 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]%} " 
  43 RPROMPT
="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}"