A Z Shell (zsh
) plugin for managing and customizing 'eza', the very colorful 'ls' replacement. View the install guide to
get it for your operating system.
- Plugin: 1.0.1
- Updated for eza: 0.17.3
While eza
needs nothing more than the EZA_COLORS
environment variable to customize its color configuration, this plugin provides
a few extra conveniences for a more complete eza
experience, such as:
- an easy to read color configuration file,
- a few sensible aliases, and
- several helpful commands to manage
eza
- Clone the repository to
.oh-my-zsh/custom/plugins
or$ZSH_CUSTOM
git clone --depth=1 https://github.com/duggum/zeza.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zeza
- Add
zeza
to the plugins array in your.zshrc
file:
plugins=(... zeza)
Note: you have to install eza
before using this plugin.
zeza
provides the following commands
Command | Description |
---|---|
help | print a help message |
configure | generate a customizable configuration file |
default | setup eza to use the default, builtin color configuration |
demo | print color codes and descriptions in their assigned colors |
nocolor | setup eza to display completely colorless output |
refresh | refresh zeza to reflect changes made to a configuration |
reset | prepends the 'reset' flag to the EZA_COLORS environment variable |
restore | restore a previous custom configuration file |
status | show the current status of the zeza plugin environment |
tables | show formatted color tables using the terminal color scheme |
For help with individual commands, run zeza <command> --help
As the name implies, this will be the primary command you use to configure eza
.
There is no need to edit EZA_COLORS
directly. The configure
command will copy
a thoroughly commented and fully customizable default configuration file called
.zeza_custom.eza
to a location of your choosing (default is $HOME
). Simply
edit the color assignments and run zeza refresh
to apply your changes.
There is a handy cheatsheet available in the docs
directory to help you if needed.
The tables
command can be especially helpful as it displays a variety of color tables that demonstrate the rendering
behavior of your terminal emulator.
For example:
zeza tables -nb
displays a color table showing normal foreground colors on bright background colors
Another useful tool is zeza tables --test
which will run a simple test to help you determine if your terminal emulator
renders bold text as bold, bright, or both bold and bright. This can be useful as setting your emulator to only render
bold text as bold allows for many more color combinations from among the base 16 color palette.
Feel free to jump down the rabbit hole if you wish to know more.
Run zeza tables --help
for detailed instructions.
The aliases provided use the following default eza
command options:
--git
--icons
--group
--group-directories-first
--sort=name
If you wish to set your own default command options, simply add the EZA_CMD_OPTS
environment variable to your .zshenv
or .zshrc
file and export it:
export EZA_CMD_OPTS="<your options here>"
When you reload your shell, zeza
will replace the internal default options with
the ones you provided via EZA_CMD_OPTS
. See: man eza
for all available options.
The following aliases are provided. They too can be overridden in your .zshenv
or .zshrc
file as desired.
# base implementation with default options
alias e='eza --git --icons --group --group-directories-first --sort=name'
# mid form implementation (plus -l, -h, and --no-user options)
alias el='e -lh --no-user'
# long form implementation (plus -l, -a, -g, and -h options)
alias ell='e -lagh'
# mid form tree listing
alias et='el --tree'
# long form tree listing
alias elt='ell --tree'
This plugin does not assume that you want to replace ls
with eza
. If you wish
to do so you can simply create your own aliases in your .zshenv
or .zshrc
file.
For example:
alias ls='eza'
alias ll='eza -la'
You may add your own aliases in your .zshenv
or .zshrc
files as you see fit. Additionally, the default aliases listed
above may be overriden by providing your own aliases with the same names.
Documentation for the main code files can be found at:
ANSI Color Sequence Cheatsheet
For eza
see the following man pages:
For ANSI colors in terminal emulators:
- Everything you never wanted to know about ANSI escape codes
- A wikipedia article covering the use of SGR parameters
- ECMA 48 5th edition