From b0b0b02f8329dcc0c032df8773dd140e0960c63f Mon Sep 17 00:00:00 2001 From: Robin knaapen Date: Fri, 12 Jul 2024 21:27:20 +0200 Subject: [PATCH] Allow eza_params to be overwritten (#31) * Allow eza_params to be overwritten * Self review --- docs/README.md | 13 +++++-------- functions/.zsh-eza | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/README.md b/docs/README.md index a44fcbe..b81d77a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -33,15 +33,12 @@ -## Default settings +### Environment variables -Sets paramters and aliases for `eza` to replace `ls`, enable auto list directories on `cd` with `export AUTOCD=1`. - -### Parameters - -```shell -eza_params=('--git' '--icons' '--classify' '--group-directories-first' '--time-style=long-iso' '--group' '--color-scale') -``` +| Variable | Description | Default | +| ------------- | -------------- | -------------- | +| _EZA_PARAMS | eza params to be used | `('--git' '--group' '--group-directories-first' '--time-style=long-iso' '--color-scale=all' '--icons')` | +| AUTOCD | enable auto list directories on `cd` | 0 | ### Aliases diff --git a/functions/.zsh-eza b/functions/.zsh-eza index aefaee5..26c48c9 100755 --- a/functions/.zsh-eza +++ b/functions/.zsh-eza @@ -19,6 +19,8 @@ if (( $+commands[eza] )); then '--time-style=long-iso' '--color-scale=all' ) + [[ ! -z $_EZA_PARAMS ]] && eza_params=($_EZA_PARAMS) + alias ls='eza $eza_params' alias l='eza --git-ignore $eza_params' alias ll='eza --all --header --long $eza_params'