Crates.io | colorizer |
lib.rs | colorizer |
version | 2.1.0 |
source | src |
created_at | 2021-06-17 10:24:43.421672 |
updated_at | 2023-09-12 19:18:48.019028 |
description | Colorizer is a tool for highlighting words in your terminal |
homepage | https://github.com/kulinsky/colorizer |
repository | https://github.com/kulinsky/colorizer |
max_upload_size | |
id | 411294 |
size | 19,594 |
Colorizer is a tool for highlighting words in your terminal. It accepts one or more pattern parameters as input and highlights each match in one of the available colors:
To see the available options, run:
$ colorizer --help
You can install Colorizer using the following command:
$ cargo install colorizer
Highlight the word "world" in red:
$ echo "hello world" | colorizer --color red --regex world
Highlight words containing the letter "r" in green:
$ echo "hello world" | colorizer --regex "\w+r\w+" --color green
On startup, Colorizer checks for a configuration file in the home directory ~/.config/colorizer/config.yml. It allows you to use profiles defined in this file.
Create a configuration file in this directory and use a profile from it via the -p or --profile parameter. If the configuration file exists and Colorizer is launched without specifying a profile name, the "default" profile will be used. Colorizer does not terminate abnormally if the configuration file is not found or if the specified profile does not exist.
If the config file exists, you can use the "my_profile" profile as follows:
$ echo "hello, world!" | colorizer -p my_profile
If the config file exists, the "default" profile will be used if no profile is specified:
echo "hello, world!" | colorizer
Here's an example of a configuration file in YAML format:
profiles:
default:
red:
- "hello .*"
- "foo"
blue:
- "bar .*"
my_profile:
red:
- ".*"
Enjoy using Colorizer and add some color to your terminal experience!