diff --git a/docs/README.md b/docs/README.md index b81d77a..f3320b8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,37 +1,6 @@ -
- - - - - -
-

- - Logo❮ Zsh eza ❯ -

-

- Zsh plugin which replace GNU/ls with eza-community/eza -

-

- 《❔》Ask a Question - 《💡》Search Wiki - 《💜》Join - 《🌐》Localize -

- - ⭕ Trunk Check - - - Visual Studio Code - -
-
+# 📂 zsh-eza + +a zsh plugin which replaces GNU/ls with eza-community/eza ### Environment variables @@ -55,55 +24,44 @@ alias tree='eza --tree $eza_params' ## Install -The `eza` should be present to use this plugin. Install `eza` with Zi: +`eza` should be present to use this plugin. Install `eza` with Cargo: ```shell -zi ice from'gh-r' as'program' sbin'**/eza -> eza' atclone'cp -vf completions/eza.zsh _eza' -zi light eza-community/eza +cargo install eza ``` -### With [Zi](https://github.com/z-shell/zi) - -To install add to the `.zshrc` file: +or your package manager of choice. -```shell -zi light z-shell/zsh-eza -``` +### With [Zi](https://github.com/z-shell/zi) -Install only if eza exists and enable auto list directories: +Add the following to your `~/.zshrc` ```shell -zi ice has'eza' atinit'AUTOCD=1' -zi light z-shell/zsh-eza +zi light givensuman/zsh-eza ``` -Install only if eza exists and enable auto list directories in turbo mode: - -```shell -zi ice wait lucid has'eza' atinit'AUTOCD=1' -zi light z-shell/zsh-eza -``` +### With [Oh My Zsh](https://ohmyz.sh/) -Install only if eza exists and enable auto list directories in turbo mode with the for syntax: +Clone the repository ```shell -zi wait lucid for \ - has'eza' atinit'AUTOCD=1' \ - z-shell/zsh-eza +git clone https://github.com/givensuman/zsh-eza \ + ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-eza ``` -### With [Oh My Zsh](https://ohmyz.sh/) - -Clone the repository and add `zsh-eza` to the plugins array of your zshrc file: +and add `zsh-eza` to the plugins array of your `~/.zshrc` ```sh -~/.oh-my-zsh/custom/plugins -``` - -```sh -plugins=(... zsh-eza) +plugins=( + ... + zsh-eza +) ``` ### With Zplug -Add `zplug z-shell/zsh-eza` to your `~/.zshrc` and re-open your terminal session. +Add the following to your `~/.zshrc` + +```shell +zplug givensuman/zsh-eza +``` diff --git a/functions/.zsh-eza b/functions/.zsh-eza index 26c48c9..dde1d85 100755 --- a/functions/.zsh-eza +++ b/functions/.zsh-eza @@ -1,10 +1,6 @@ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# -# Copyright (c) 2022 Salvydas Lukosius - if [[ $TERM == 'dumb' ]]; then - return 1 + print "Error loading zsh-eza: plugin used in a dumb terminal." >&2 + return fi builtin emulate -L zsh ${=${options[xtrace]:#off}:+-o xtrace} @@ -32,13 +28,11 @@ if (( $+commands[eza] )); then [[ "$AUTOCD" = <-> ]] && enable_autocd="$AUTOCD" if [[ "$enable_autocd" == "1" ]]; then - # Function for cd auto list directories + # Function to call eza when changing directory →auto-eza() { command eza $eza_params; } [[ $chpwd_functions[(r)→auto-eza] == →auto-eza ]] || chpwd_functions=( →auto-eza $chpwd_functions ) fi else - print "Please install eza before using this plugin." >&2 - return 1 + print "Error loading zsh-eza: eza not found." >&2 + return fi - -return 0 diff --git a/zsh-eza.plugin.zsh b/zsh-eza.plugin.zsh index 1b6ab03..c19ed61 100755 --- a/zsh-eza.plugin.zsh +++ b/zsh-eza.plugin.zsh @@ -1,9 +1,3 @@ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# -# Copyright (c) 2022 Salvydas Lukosius -# -# Zsh Plugin Standard # https://wiki.zshell.dev/community/zsh_plugin_standard#zero-handling 0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}" 0="${${(M)0:#/*}:-$PWD/$0}" @@ -12,7 +6,7 @@ typeset -gA Plugins Plugins[ZSH_EZA]="${0:h}" -# https://wiki.zshell.dev/community/zsh_plugin_standard#funtions-directory +# https://wiki.zshell.dev/community/zsh_plugin_standard#functions-directory if [[ $PMSPEC != *f* ]]; then fpath+=( "${0:h}/functions" ) fi @@ -21,9 +15,6 @@ autoload -Uz .zsh-eza # Load plugin (( ${+functions[.zsh-eza]} )) && { - .zsh-eza; (( $? )) && { - print "Error loading zsh-eza plugin, exit code: $?" - exit 1 - } + .zsh-eza }