vivid
vivid copied to clipboard
Add "c" command to generate escape sequences for a given style
This adds a "c" command which will generate the escape sequence for a style defined in the given theme category. This is allows me to do automate colors for my prompt in .bashrc/.zshrc, for example:
export VIVID_THEME="catppuccin-mocha"
icon_style="$(vivid c programming.source)";
dir_style="$(vivid c core.directory)";
reset="$(vivid c reset)";
[[ -z "$ICON" ]] && ICON=""
PROMPT="%{${icon_style}%}${ICON} "
PROMPT+=" %{${dir_style}%}%c%{$reset%} "
export PROMPT
export CLICOLOR=1
export LS_COLORS="$(vivid generate)"
This looks interesting, thank you very much for your contribution! Can we find a better (longer) name for this option? If it's mainly used in scripts, I would prefer a self-descriptive name over something short.
It would also be great to add an integration test to tests/main.rs.