zsh: customize EZA_COLORS

This commit is contained in:
Fernando Schauenburg 2024-03-11 00:14:40 +01:00
parent abdedb4ce9
commit 316ff49b08
3 changed files with 103 additions and 1 deletions

View file

@ -10,6 +10,10 @@ if command -v broot >/dev/null 2>&1; then
source "$ZDOTDIR/broot.zsh"
fi
if command -v eza >/dev/null 2>&1; then
source "$ZDOTDIR/eza.zsh"
fi
if command -v fzf >/dev/null 2>&1; then
source "$ZDOTDIR/fzf.zsh"
fi

View file

@ -3,7 +3,7 @@
if command -v eza >/dev/null 2>&1; then
# Prefer eza if installed
alias \
ls="eza --classify --group-directories-first --group --links" \
ls="eza --classify --group-directories-first --group --links --smart-group" \
la="ls --all" \
lt="ls --long --tree --ignore-glob='.git'" \
lta="lt --all" \

98
config/zsh/eza.zsh Executable file
View file

@ -0,0 +1,98 @@
black=30
red=31
green=32
yellow=33
blue=34
magenta=35
cyan=36
white=37
colors=(
di=$blue # directories
ex=$green # executable files
# fi # regular files
# pi # named pipes
# so # sockets
# bd # block devices
# cd # character devices
# ln # symlinks
# or # symlinks with no target
# oc # the permissions displayed as octal
ur=$yellow # the user-read permission bit
uw=$red # the user-write permission bit
ux=$green # the user-execute permission bit for regular files
ue=$green # the user-execute for other file kinds
# gr # the group-read permission bit
# gw # the group-write permission bit
# gx # the group-execute permission bit
# tr # the others-read permission bit
# tw # the others-write permission bit
# tx # the others-execute permission bit
# su # setuid, setgid, and sticky permission bits for files
# sf # setuid, setgid, and sticky for other file kinds
# xa # the extended attribute indicator
# sn # the numbers of a files size (sets nb, nk, nm, ng and nt)
# nb # the numbers of a files size if it is lower than 1 KB/Kib
nk=$green # the numbers of a files size if it is between 1 KB/KiB and 1 MB/MiB
# nm # the numbers of a files size if it is between 1 MB/MiB and 1 GB/GiB
# ng # the numbers of a files size if it is between 1 GB/GiB and 1 TB/TiB
# nt # the numbers of a files size if it is 1 TB/TiB or higher
# sb # the units of a files size (sets ub, uk, um, ug and ut)
# ub # the units of a files size if it is lower than 1 KB/Kib
# uk # the units of a files size if it is between 1 KB/KiB and 1 MB/MiB
# um # the units of a files size if it is between 1 MB/MiB and 1 GB/GiB
# ug # the units of a files size if it is between 1 GB/GiB and 1 TB/TiB
# ut # the units of a files size if it is 1 TB/TiB or higher
# df # a devices major ID
# ds # a devices minor ID
uu=$white # a user thats you
uR=$red # a user thats root
un=$yellow # a user thats someone else
gu=$white # a group that you belong to
gR=$red # a group related to root
gn=$yellow # a group you arent a member of
lc=$red # a number of hard links
# lm # a number of hard links for a regular file with at least two
# ga # a new flag in Git
# gm # a modified flag in Git
# gd # a deleted flag in Git
# gv # a renamed flag in Git
# gt # a modified metadata flag in Git
# gi # an ignored flag in Git
# gc # a conflicted flag in Git
# Gm # main branch of repo
# Go # other branch of repo
# Gc # clean branch of repo
# Gd # dirty branch of repo
# xx # “punctuation”, including many background UI elements
# da # a files date
# in # a files inode number
# bl # a files number of blocks
# hd # the header row of a table
# lp # the path of a symlink
# cc # an escaped character in a filename
# bO # the overlay style for broken symlink paths
# sp # special (not file, dir, mount, exec, pipe, socket, block device, char device, or link)
# mp # a mount point
# im # a regular file that is an image
# vi # a regular file that is a video
# mu # a regular file that is lossy music
# lo # a regular file that is lossless music
# cr # a regular file that is related to cryptography (ex: key or certificate)
# do # a regular file that is a document (ex: office suite document or PDF)
# co # a regular file that is compressed
# tm # a regular file that is temporary (ex: a text editors backup file)
# cm # a regular file that is a compilation artifact (ex: Java class file)
bu=$yellow # a regular file that is used to build a project (ex: Makefile)
sc=$yellow # a regular file that is source code
# Sn # No security context on a file
# Su # SELinux user
# Sr # SELinux role
# St # SELinux type
# Sl # SELinux level
# ff # BSD file flags
)
export EZA_COLORS="${(pj.:.)colors}"
unset colors