Crates.io | chromazone |
lib.rs | chromazone |
version | 1.0.1 |
source | src |
created_at | 2024-03-17 21:14:11.953985 |
updated_at | 2024-03-19 13:16:52.108137 |
description | chromazone is a line-oriented match and colorization tool. |
homepage | https://github.com/matze/chromazone |
repository | https://github.com/matze/chromazone |
max_upload_size | |
id | 1176822 |
size | 35,274 |
Chromazone is a banger tune by Mike Stern and a terminal colorizer.
Why not colorizer or pipecolor? Because it features
See the CHANGELOG for a release history.
For one-off uses, pipe some output into to the cz
binary and pass regex
patterns and corresponding color and effect descriptions with the -m
or
--match
argument like so
cat README.md | cz -m "\[[^\[]*\]" red,underline -m "^# .*$" yellow,bold
which should give the following output
To re-use style definitions, create a
$HOME/.config/chromazone/chromazone.styles
configuration file and specify
sections for each style containing one or more match patterns and style
descriptions like this
[diff]
"^@@.*@@$" yellow
"^-.*" red
"^+.*" green
The style can then specified with the -s
or --style
argument
diff Cargo.toml Cargo.lock | cz -s diff
Note that you can still extend given styles with additional -m
arguments.
Style descriptions are comma-separated lists of foreground colors (black
,
blue
, cyan
, green
, magenta
, purple
, red
, white
and yellow
),
background colors (b:black
, b:blue
, b:cyan
, b:green
, b:magenta
,
b:purple
, b:red
, b:white
and b:yellow
) and effects (bold
, italic
,
underline
and strike
).
For now you need a Rust toolchain and install it via cargo
:
cargo install chromazone