abra zsh config 2.0

This commit is contained in:
Andrey Anurin
2018-08-12 15:26:21 +03:00
parent 201abd09c4
commit 6b114440e2
1195 changed files with 68948 additions and 10539 deletions

View File

@@ -26,7 +26,9 @@
# A few utility functions to make it easy and re-usable to draw segmented prompts
CURRENT_BG='NONE'
PRIMARY_FG=black
if [[ -z "$PRIMARY_FG" ]]; then
PRIMARY_FG=black
fi
# Characters
SEGMENT_SEPARATOR="\ue0b0"
@@ -97,7 +99,7 @@ prompt_git() {
ref="$DETACHED ${ref/.../}"
fi
prompt_segment $color $PRIMARY_FG
print -Pn " $ref"
print -n " $ref"
fi
}
@@ -120,12 +122,22 @@ prompt_status() {
[[ -n "$symbols" ]] && prompt_segment $PRIMARY_FG default " $symbols "
}
# Display current virtual environment
prompt_virtualenv() {
if [[ -n $VIRTUAL_ENV ]]; then
color=cyan
prompt_segment $color $PRIMARY_FG
print -Pn " $(basename $VIRTUAL_ENV) "
fi
}
## Main prompt
prompt_agnoster_main() {
RETVAL=$?
CURRENT_BG='NONE'
prompt_status
prompt_context
prompt_virtualenv
prompt_dir
prompt_git
prompt_end