diff options
author | Dennis Eriksen <dennis@eriksen.im> | 2016-05-20 11:23:59 +0200 |
---|---|---|
committer | Dennis Eriksen <dennis@eriksen.im> | 2016-05-20 11:23:59 +0200 |
commit | cd7ec7da952466e0ee834f5842e983d0f636bd21 (patch) | |
tree | a34c8d236d16a2e61b3bbef3acf86915f3687a27 /prompt_adam3_setup | |
parent | just adding more comments (diff) | |
download | adam3-cd7ec7da952466e0ee834f5842e983d0f636bd21.tar.gz |
lets add some VCS info
Diffstat (limited to 'prompt_adam3_setup')
-rw-r--r-- | prompt_adam3_setup | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/prompt_adam3_setup b/prompt_adam3_setup index 77ed90e..5f7fa67 100644 --- a/prompt_adam3_setup +++ b/prompt_adam3_setup @@ -12,6 +12,8 @@ EOF prompt_adam3_setup () { + autoload -Uz vcs_info + # colors prompt_adam3_color1=${1:-'multi'} prompt_adam3_color2=${2:-'blue'} @@ -57,6 +59,11 @@ prompt_adam3_setup () { prompt_adam3_precmd () { # setopt noxtrace localoptions + zstyle ':vcs_info:*' enable git svn + zstyle ':vcs_info:*' check-for-changes true + zstyle ':vcs_info:*' formats "%F{grey}%s %F{green}%b%{$reset_color%} %F{red}%m%u%c%f" + #zstyle ':vcs_info:git*' actionformats "%s %r/%S %b %m%u%c " + vcs_info local base_prompt_expanded_no_color base_prompt_etc local prompt_length space_left promptchar @@ -67,19 +74,18 @@ prompt_adam3_precmd () { # Changing the prompt based on the length of the prompt, should happen based # on how long it actually is. The method below will need to be changed. if [[ $prompt_length -lt 69 ]]; then - path_prompt="%B%F{$prompt_adam3_color3}%(4~|...|)%3~%F{white}" + path_prompt="%B%F{$prompt_adam3_color3}%(4~|...|)%3~%F{white}%b" else space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 )) - path_prompt="%B%F{$prompt_adam3_color4}%${space_left}<...<%~$prompt_newline%F{white}" + path_prompt="%B%F{$prompt_adam3_color4}%${space_left}<...<%~$prompt_newline%F{white}%b" fi # make promptchar bold red if root - if [[ $EUID == 0 ]]; then promptchar="%F{red}%B%#%b%f"; else promptchar="%#"; fi - + if [[ $EUID == 0 ]]; then promptchar="%F{red}%B%#%b%f"; else promptchar="%B%#%b"; fi - PS1="$base_prompt$path_prompt $promptchar $post_prompt" - PS2="$base_prompt$path_prompt %_> $post_prompt" - PS3="$base_prompt$path_prompt ?# $post_prompt" + PS1="$base_prompt$path_prompt${vcs_info_msg_0_} $promptchar $post_prompt" + PS2="$base_prompt$path_prompt${vcs_info_msg_0_} %_> $post_prompt" + PS3="$base_prompt$path_prompt${vcs_info_msg_0_} ?# $post_prompt" } prompt_adam3_setup "$@" |