vivid icon indicating copy to clipboard operation
vivid copied to clipboard

Add "c" command to generate escape sequences for a given style

Open bendavis78 opened this issue 6 months ago • 1 comments

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)"

bendavis78 avatar Jun 28 '25 18:06 bendavis78

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.

sharkdp avatar Aug 31 '25 19:08 sharkdp