From ba193c1c01c42a772c4fe0b248938877c5873e56 Mon Sep 17 00:00:00 2001 From: Gregor Gebhardt Date: Mon, 23 Apr 2018 17:02:33 +0200 Subject: [PATCH] merged conda prompt with virtualenv prompt and removed theme_display_conda setting. --- fish_prompt.fish | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index f580f85..9b98641 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -29,7 +29,6 @@ # set -g theme_display_k8s_context no # set -g theme_display_hg yes # set -g theme_display_virtualenv no -# set -g theme_display_conda no # set -g theme_display_ruby no # set -g theme_display_user ssh # set -g theme_display_hostname ssh @@ -674,24 +673,18 @@ function __bobthefish_virtualenv_python_version -S -d 'Get current Python versio end end -function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)" - [ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" ]; and return +function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself) or conda environment." + [ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" -a -z "$CONDA_DEFAULT_ENV" ]; and return set -l version_glyph (__bobthefish_virtualenv_python_version) if [ "$version_glyph" ] __bobthefish_start_segment $color_virtualfish echo -ns $virtualenv_glyph $version_glyph ' ' end - echo -ns (basename "$VIRTUAL_ENV") ' ' -end - -function __bobthefish_prompt_conda -S -d "Display current conda envrionment." - [ "$theme_display_conda" = 'no' -o -z "$CONDA_DEFAULT_ENV" ]; and return - set -l version_glyph (__bobthefish_virtualenv_python_version) - if [ "$version_glyph" ] - __bobthefish_start_segment $color_virtualfish - echo -ns $virtualenv_glyph $version_glyph ' ' + if [ "$VIRTUAL_ENV" ] + echo -ns (basename "$VIRTUAL_ENV") ' ' + else if [ "$CONDA_DEFAULT_ENV" ] + echo -ns (basename "$CONDA_DEFAULT_ENV") ' ' end - echo -ns (basename "$CONDA_DEFAULT_ENV") ' ' end function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment'