From af7c6cba132043e1e4167520bd89ba40c8eee9a9 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Thu, 7 Sep 2023 05:57:39 -0700 Subject: [PATCH] chore: use eza instead of exa Exa is deprecated. See https://github.com/ogham/exa/issues/1243 --- .gitattributes | 2 +- .trunk/trunk.yaml | 2 +- docs/README.md | 64 ++++++++++++------------ functions/{.zsh-exa => .zsh-eza} | 28 +++++------ zsh-exa.plugin.zsh => zsh-eza.plugin.zsh | 10 ++-- 5 files changed, 53 insertions(+), 53 deletions(-) rename functions/{.zsh-exa => .zsh-eza} (51%) rename zsh-exa.plugin.zsh => zsh-eza.plugin.zsh (78%) diff --git a/.gitattributes b/.gitattributes index 4b1adf8..9452112 100644 --- a/.gitattributes +++ b/.gitattributes @@ -53,7 +53,7 @@ *.fish text eol=lf *.sh text eol=lf *.zsh text eol=lf -functions/.zsh-exa text eol=lf +functions/.zsh-eza text eol=lf # These are explicitly windows files and should use crlf *.bat text eol=crlf *.cmd text eol=crlf diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index b526d90..d81b23e 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -14,7 +14,7 @@ repo: repo: host: github.com owner: zplugin - name: zsh-exa + name: zsh-eza actions: enabled: - git-blame-ignore-revs diff --git a/docs/README.md b/docs/README.md index b02a889..26b838e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,13 +2,13 @@

- + Logo❮ Zsh exa ❯ + alt="Logo" />❮ Zsh eza ❯

- Zsh plugin which replace GNU/ls with ogham/exa + Zsh plugin which replace GNU/ls with eza-community/eza

《❔》Ask a Question @@ -18,10 +18,10 @@

- - ⭕ Trunk Check + + ⭕ Trunk Check - + exa' atclone'cp -vf completions/exa.zsh _exa' -zi light ogham/exa +zi ice from'gh-r' as'program' sbin'**/eza -> eza' atclone'cp -vf completions/eza.zsh _eza' +zi light eza-community/eza ``` ### With [Zi](https://github.com/z-shell/zi) @@ -70,43 +70,43 @@ zi light ogham/exa To install add to the `.zshrc` file: ```shell -zi light zplugin/zsh-exa +zi light zplugin/zsh-eza ``` -Install only if exa exists and enable auto list directories: +Install only if eza exists and enable auto list directories: ```shell -zi ice has'exa' atinit'AUTOCD=1' -zi light zplugin/zsh-exa +zi ice has'eza' atinit'AUTOCD=1' +zi light zplugin/zsh-eza ``` -Install only if exa exists and enable auto list directories in turbo mode: +Install only if eza exists and enable auto list directories in turbo mode: ```shell -zi ice wait lucid has'exa' atinit'AUTOCD=1' -zi light zplugin/zsh-exa +zi ice wait lucid has'eza' atinit'AUTOCD=1' +zi light zplugin/zsh-eza ``` -Install only if exa exists and enable auto list directories in turbo mode with the for syntax: +Install only if eza exists and enable auto list directories in turbo mode with the for syntax: ```shell zi wait lucid for \ - has'exa' atinit'AUTOCD=1' \ - zplugin/zsh-exa + has'eza' atinit'AUTOCD=1' \ + zplugin/zsh-eza ``` ### With [Oh My Zsh](https://ohmyz.sh/) -Clone the repository and add `zsh-exa` to the plugins array of your zshrc file: +Clone the repository and add `zsh-eza` to the plugins array of your zshrc file: ```sh ~/.oh-my-zsh/custom/plugins ``` ```sh -plugins=(... zsh-exa) +plugins=(... zsh-eza) ``` ### With Zplug -Add `zplug zplugin/zsh-exa` to your `~/.zshrc` and re-open your terminal session. +Add `zplug zplugin/zsh-eza` to your `~/.zshrc` and re-open your terminal session. diff --git a/functions/.zsh-exa b/functions/.zsh-eza similarity index 51% rename from functions/.zsh-exa rename to functions/.zsh-eza index 37faa3e..c8a4eb2 100755 --- a/functions/.zsh-exa +++ b/functions/.zsh-eza @@ -10,32 +10,32 @@ fi builtin emulate -L zsh ${=${options[xtrace]:#off}:+-o xtrace} builtin setopt extended_glob warn_create_global typeset_silent -if (( $+commands[exa] )); then +if (( $+commands[eza] )); then typeset enable_autocd=0 - typeset -ag exa_params + typeset -ag eza_params - exa_params=( + eza_params=( '--git' '--icons' '--classify' '--group' '--group-directories-first' '--time-style=long-iso' '--color-scale' ) - alias ls='exa $exa_params' - alias l='exa --git-ignore $exa_params' - alias ll='exa --all --header --long $exa_params' - alias llm='exa --all --header --long --sort=modified $exa_params' - alias la='exa -lbhHigUmuSa' - alias lx='exa -lbhHigUmuSa@' - alias lt='exa --tree $exa_params' - alias tree='exa --tree $exa_params' + alias ls='eza $eza_params' + alias l='eza --git-ignore $eza_params' + alias ll='eza --all --header --long $eza_params' + alias llm='eza --all --header --long --sort=modified $eza_params' + alias la='eza -lbhHigUmuSa' + alias lx='eza -lbhHigUmuSa@' + alias lt='eza --tree $eza_params' + alias tree='eza --tree $eza_params' [[ "$AUTOCD" = <-> ]] && enable_autocd="$AUTOCD" if [[ "$enable_autocd" == "1" ]]; then # Function for cd auto list directories - →auto-exa() { command exa $exa_params; } - [[ $chpwd_functions[(r)→auto-exa] == →auto-exa ]] || chpwd_functions=( →auto-exa $chpwd_functions ) + →auto-eza() { command eza $eza_params; } + [[ $chpwd_functions[(r)→auto-eza] == →auto-eza ]] || chpwd_functions=( →auto-eza $chpwd_functions ) fi else - print "Please install exa before using this plugin." >&2 + print "Please install eza before using this plugin." >&2 return 1 fi diff --git a/zsh-exa.plugin.zsh b/zsh-eza.plugin.zsh similarity index 78% rename from zsh-exa.plugin.zsh rename to zsh-eza.plugin.zsh index 64be852..1b6ab03 100755 --- a/zsh-exa.plugin.zsh +++ b/zsh-eza.plugin.zsh @@ -10,19 +10,19 @@ # https://wiki.zshell.dev/community/zsh_plugin_standard#standard-plugins-hash typeset -gA Plugins -Plugins[ZSH_EXA]="${0:h}" +Plugins[ZSH_EZA]="${0:h}" # https://wiki.zshell.dev/community/zsh_plugin_standard#funtions-directory if [[ $PMSPEC != *f* ]]; then fpath+=( "${0:h}/functions" ) fi -autoload -Uz .zsh-exa +autoload -Uz .zsh-eza # Load plugin -(( ${+functions[.zsh-exa]} )) && { - .zsh-exa; (( $? )) && { - print "Error loading zsh-exa plugin, exit code: $?" +(( ${+functions[.zsh-eza]} )) && { + .zsh-eza; (( $? )) && { + print "Error loading zsh-eza plugin, exit code: $?" exit 1 } }