From 5b244eeadbfbd30b81fcd433f3e51072996c27c6 Mon Sep 17 00:00:00 2001 From: Jeef Date: Mon, 7 Aug 2017 15:02:20 -0400 Subject: [PATCH] Update prompt_sorin_setup Added python support --- modules/prompt/functions/prompt_sorin_setup | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 6856de6..74bd417 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -81,6 +81,12 @@ function prompt_sorin_precmd { fi fi + + # Run python info (this should be fast and not require any async) + if (( $+functions[python-info] )); then + python-info + fi + # Compute slow commands in the background. async_job async_sorin_git prompt_sorin_async_git "$PWD" } @@ -123,6 +129,10 @@ function prompt_sorin_setup { zstyle ':prezto:module:git:info:keys' format \ 'status' '%b %p %c:%s%A%B%S%a%d%m%r%U%u' + + # Set python-info format + zstyle ':prezto:module:python:info:virtualenv' format '%f%F{208}(%v)%F{7}' + # Get the async worker set up async_start_worker async_sorin_git -n async_register_callback async_sorin_git prompt_sorin_git_info @@ -133,7 +143,7 @@ function prompt_sorin_setup { # Define prompts. PROMPT='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%f "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} ' - RPROMPT='${editor_info[overwrite]}%(?:: %F{1}⏎%f)${VIM:+" %B%F{6}V%f%b"}${_prompt_sorin_git}' + RPROMPT='$python_info[virtualenv] ${editor_info[overwrite]}%(?:: %F{1}⏎%f)${VIM:+" %B%F{6}V%f%b"}${_prompt_devel_git}' SPROMPT='zsh: correct %F{1}%R%f to %F{2}%r%f [nyae]? ' }