X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/fab93d61dc5d1cb52f6e3e83a99fc0aeaa2cb29a..14a899db10b88c5e4800e34dc208a0ce3b624dcd:/zsh/modules/prompt.zsh?ds=sidebyside diff --git a/zsh/modules/prompt.zsh b/zsh/modules/prompt.zsh index 2b7454d..0ab1e0d 100644 --- a/zsh/modules/prompt.zsh +++ b/zsh/modules/prompt.zsh @@ -22,23 +22,22 @@ function env_info { } function python_info { - pythoninfo=`asdf current python | sed 's/ */ /g' | cut -d ' ' -f 2` - if [[ -z "$VIRTUAL_ENV" ]]; then - venv="default" - else - venv="${VIRTUAL_ENV##*/}" - fi - echo "%{%F{green}%}py%{%F{black}%} ${pythoninfo}@${venv}" + pythoninfo=`cat ~/.tool-versions | rg python | cut -d ' ' -f 2` + pythoninfo=${ASDF_PYTHON_VERSION:-$pythoninfo} + venv="${VIRTUAL_ENV##*/}" + echo "%{%F{green}%}py%{%F{black}%} ${pythoninfo:-no}@${venv:-default}" } function ruby_info { - rubyinfo=`asdf current ruby | sed 's/ */ /g' | cut -d ' ' -f 2` - echo "%{%F{red}%}rb%{%F{black}%} ${rubyinfo}" + rubyinfo=`cat ~/.tool-versions | rg ruby | cut -d ' ' -f 2` + rubyinfo=${ASDF_RUBY_VERSION:-$rubyinfo} + echo "%{%F{red}%}rb%{%F{black}%} ${rubyinfo:-no}" } function node_info { - nodeinfo=`asdf current nodejs | sed 's/ */ /g' | cut -d ' ' -f 2` - echo "%{%F{yellow}%}js%{%F{black}%} ${nodeinfo}" + nodeinfo=`cat ~/.tool-versions | rg nodejs | cut -d ' ' -f 2` + nodeinfo=${ASDF_NODEJS_VERSION:-$nodeinfo} + echo "%{%F{yellow}%}js%{%F{black}%} ${nodeinfo:-no}" } function box_name {