X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/aa942a2d6309db1a76a35444e3beaf3a027e4422..fab93d61dc5d1cb52f6e3e83a99fc0aeaa2cb29a:/zsh/modules/prompt.zsh diff --git a/zsh/modules/prompt.zsh b/zsh/modules/prompt.zsh index 482bfc7..2b7454d 100644 --- a/zsh/modules/prompt.zsh +++ b/zsh/modules/prompt.zsh @@ -16,31 +16,29 @@ function prompt_precmd { # Functions # -function virtualenv_info { +function env_info_provider() { echo "%{%F{green}%}n/a"; } +function env_info { + echo "[%{%F{cyan}%}ENV%{%F{black}%} $(env_info_provider)%{%F{black}%}]" +} + +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}%} ${venv}" + echo "%{%F{green}%}py%{%F{black}%} ${pythoninfo}@${venv}" } -function rvm_info { - if [[ -z "$RUBY_VERSION" ]]; then - rvminfo="default" - else - rvminfo=`rvm-prompt` - fi - echo "%{%F{red}%}rb%{%F{black}%} ${rvminfo}" +function ruby_info { + rubyinfo=`asdf current ruby | sed 's/ */ /g' | cut -d ' ' -f 2` + echo "%{%F{red}%}rb%{%F{black}%} ${rubyinfo}" } -function nvm_info { - if [[ -z "$NVM_BIN" ]]; then - nvminfo="default" - else - nvminfo=`nvm current` - fi - echo "%{%F{yellow}%}js%{%F{black}%} ${nvminfo}" +function node_info { + nodeinfo=`asdf current nodejs | sed 's/ */ /g' | cut -d ' ' -f 2` + echo "%{%F{yellow}%}js%{%F{black}%} ${nodeinfo}" } function box_name { @@ -102,7 +100,7 @@ function prompt_setup { # Define prompts. PROMPT=' -%{%F{black}%}$(nvm_info) $(rvm_info) $(virtualenv_info) +%{%F{black}%}$(env_info) $(node_info) $(ruby_info) $(python_info) %{%F{magenta}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%f%} %(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ ' }