tide/functions/_tide_item_virtual_env.fish

12 lines
427 B
Fish
Raw Normal View History

2020-06-28 21:44:40 +03:00
function _tide_item_virtual_env
2020-09-08 17:43:51 +03:00
if set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV")
set_color $tide_virtual_env_color
# Avoid printing a generic name
if contains -- $splitVirtualEnv[-1] virtualenv venv .venv env
2020-09-08 17:43:51 +03:00
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-2]
else
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-1]
2020-06-28 21:44:40 +03:00
end
end
2021-03-02 20:46:40 +03:00
end