Home

Awesome

asdf-prompt plugin for zsh/oh-my-zsh

A zsh prompt for asdf users that displays information about your current tool versions.

Examples

The plugin will by default stay quiet when asdf tool versions are at your global settings.

If you are in a folder affected by a .tool-versions file or have set a $ASDF_*_VERSION it will list the changed versions. Here, I have tweaked versions of python and nodejs:
Screenshot #1.1

You can embellish with details on versions and version resolution with the $ZSH_THEME_ASDF_PROMPT_* environment variables:
Screenshot #1.2
See section on environment variables further down to learn about the options.

Requirements

Currently only really tested with oh-my-zsh.

Install

Run

git clone https://github.com/CurryEleison/zsh-asdf-prompt.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-asdf-prompt

to install the plugin into your custom folder. Activate the plugin in ~/.zshrc:

plugins=( [plugins...] zsh-asdf-prompt)

Add the prompt info in your theme with $(asdf_prompt_info). E.g.

PROMPT='%n@%m $(asdf_prompt_info)${(s:/:)PWD/#$HOME/~}%(!.#.>) '
ZSH_THEME_ASDF_PROMPT_PREFIX="%{$fg_bold[magenta]%}{"
ZSH_THEME_ASDF_PROMPT_POSTFIX="}%{$reset_color%} "
ZSH_THEME_ASDF_PROMPT_VERSION_RESOLUTION="COMPACT"

Environment variables in use