merged conda prompt with virtualenv prompt and removed theme_display_conda setting.

This commit is contained in:
Gregor Gebhardt 2018-04-23 17:02:33 +02:00
parent a1843ef7ab
commit ba193c1c01

View File

@ -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
if [ "$VIRTUAL_ENV" ]
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
else if [ "$CONDA_DEFAULT_ENV" ]
echo -ns (basename "$CONDA_DEFAULT_ENV") ' '
end
end
function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment'