From a1843ef7ab0f1f07efa3d8c5bf8427046858e0b9 Mon Sep 17 00:00:00 2001 From: Gregor Gebhardt Date: Wed, 18 Apr 2018 20:21:42 +0200 Subject: [PATCH] added support for conda environments. --- fish_prompt.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fish_prompt.fish b/fish_prompt.fish index 5c3d775..f580f85 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -29,6 +29,7 @@ # 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 @@ -683,6 +684,16 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e 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 ' ' + end + echo -ns (basename "$CONDA_DEFAULT_ENV") ' ' +end + function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment' [ "$theme_display_virtualgo" = 'no' -o -z "$VIRTUALGO" ]; and return __bobthefish_start_segment $color_virtualgo @@ -887,6 +898,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_desk __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish + __bobthefish_prompt_conda __bobthefish_prompt_virtualgo # VCS