From b5eedbf3ba31b4d416e2918da960a2e385547442 Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Sun, 15 Mar 2015 17:13:58 -0300 Subject: [PATCH] Added virtualenv info to prompt. Added virtualenv info to paradox prompt. whitespace Updated authors list in paradox prompt file Changed virtualenv color to yellow to better distinguish directory segment, which was also blue before Fixed bug when deactivating virtualenv, it left an empty segment. Now deactivating removes entire virtualenv segment. Formatting --- modules/prompt/functions/prompt_paradox_setup | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/prompt/functions/prompt_paradox_setup b/modules/prompt/functions/prompt_paradox_setup index 36ae40ec..c8d14c83 100644 --- a/modules/prompt/functions/prompt_paradox_setup +++ b/modules/prompt/functions/prompt_paradox_setup @@ -8,6 +8,7 @@ # Isaac Wolkerstorfer # Jeff Sandberg # Sorin Ionescu +# Milind Shakya # # Screenshots: # http://i.imgur.com/0XIWX.png @@ -51,6 +52,10 @@ function prompt_paradox_build_prompt { if [[ -n "$git_info" ]]; then prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}' fi + + if [[ -n "${python_info}" ]]; then + prompt_paradox_start_segment yellow black '${python_info[ref]}${python_info[virtualenv]}' + fi prompt_paradox_end_segment } @@ -96,6 +101,11 @@ function prompt_paradox_precmd { if (( $+functions[git-info] )); then git-info fi + + # Get Virtual env info + if (( $+functions[python-info] )); then + python-info + fi # Calculate and print the elapsed time. prompt_paradox_print_elapsed_time @@ -142,6 +152,9 @@ function prompt_paradox_setup { zstyle ':prezto:module:git:info:keys' format \ 'ref' '$(coalesce "%b" "%p" "%c")' \ 'status' '%s%D%A%B%S%a%d%m%r%U%u' + + # Set python-info parameters. + zstyle ':prezto:module:python:info:virtualenv' format '%F{black}py:%v%f' # Define prompts. PROMPT='