diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-06-28 20:10:41 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-06-28 20:10:41 +0200 |
| commit | 3cfb240230ff88aa9a222a12926bd475d4e9eebf (patch) | |
| tree | 0990a2da7cd9ea5dca6469344ed21cb6eb52e65f /zsh/modules | |
| parent | cd3948f4d8c338ed47ffd28f7cb92d5e6ced80e8 (diff) | |
Simplify prompt functions
Diffstat (limited to 'zsh/modules')
| -rw-r--r-- | zsh/modules/prompt.zsh | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/zsh/modules/prompt.zsh b/zsh/modules/prompt.zsh index 2b7454d..a305178 100644 --- a/zsh/modules/prompt.zsh +++ b/zsh/modules/prompt.zsh @@ -22,23 +22,19 @@ 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` + 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` + 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` + echo "%{%F{yellow}%}js%{%F{black}%} ${nodeinfo:-no}" } function box_name { |