diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..7574889 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,35 @@ +# fish-eza — Repository Guidelines + +## Project Structure & Module Organization + +fish shell plugin that replaces `ls`-style aliases with `eza` equivalents. Installed via [Fisher](https://github.com/jorgebucaran/fisher) 4.0+. + +| Path | Purpose | +|------|---------| +| `conf.d/fish-eza.fish` | Main entry point — install/update/uninstall event handlers. Defines all aliases and their `EZA_*_OPTIONS` env vars. | +| `functions/eza_git.fish` | Auto-detects git repos and appends `--git` to `ll*` aliases. | + +## Build, Test, and Development Commands + +No build system or test suite. This is a pure fish shell plugin. + +- **Install locally**: `fisher install ./fish-eza` (from parent dir) or clone and `fisher install ` +- **Uninstall**: `fisher uninstall plttn/fish-eza` +- **Validate syntax**: `fish --check conf.d/fish-eza.fish && fish --check functions/eza_git.fish` +- **Test in shell**: `fish` then run `ll`, `lla`, `ltaa`, etc. + +## Coding Style & Naming Conventions + +- Fish shell syntax: 4-space indentation, `set` for variables, `function` blocks for logic +- Env vars are uppercase with underscores: `EZA_STANDARD_OPTIONS`, `EZA_LL_OPTIONS`, `EZA_LI_OPTIONS` +- Internal vars prefixed with `__FISH_EZA_` to avoid collisions +- Alias names are lowercase short forms: `l`, `ll`, `lg`, `le`, `lt`, `lc`, `lo` +- Extended aliases append suffixes: `lla`, `llad`, `ltaa`, etc. +- `ll*` aliases route through `eza_git` function (auto `--git` in git repos); all others call `eza` directly + +## Key Conventions + +- Extended options are **prepended** to base alias options in the alias expansion +- `ltaa` and `ltaac` are skipped (`--tree` is useless with `--all --all`) +- Config uses `set -Ux` for universal exports; users should avoid quotes — set vars as lists +- No nested AGENTS.md or project skills needed for this small repo diff --git a/README.md b/README.md index 031ae5b..fd6546d 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,12 @@ fisher install plttn/fish-eza | alias | default options | | ---------------- | -------------------------------------------------------------------------- | | `l` | `eza` | +| `ls` | `eza` | | `ll` | `eza --group --header --group-directories-first --long` | | `ll` in git repo | `eza --group --header --group-directories-first --long --git` | | `lg` | `eza --group --header --group-directories-first --long --git --git-ignore` | | `le` | `eza --group --header --group-directories-first --long --extended` | -| `lt` | `eza --group --header --group-directories-first --tree --level LEVEL` | +| `lt` | `eza --group --header --group-directories-first --tree --level 2` | | `lc` | `eza --group --header --group-directories-first --across` | | `lo` | `eza --group --header --group-directories-first --oneline` | @@ -33,12 +34,12 @@ Each base alias has its extended versions with additional options. An extended alias is one of the form `` with suffix from the following: -| Extend suffix | Default options | +| Extend suffix | Default options | | ------------- | ------------------------------------------ | | `a` | `--all --binary` | | `d` | `--only-dirs` | -| `i` | `--icons` | -| `id` | `--icons --only-dirs` | +| `i` | `--icons` | +| `id` | `--icons --only-dirs` | | `aa` | `--all --binary --all` | | `ad` | `--all --binary --only-dirs` | | `ai` | `--all --binary --icons` | @@ -58,7 +59,7 @@ ezamples: llad => --all --binary --only-dirs --group --header --group-directories-first --long ------------ad------------ -----------------------ll------------------------ -ltaa => --all --binary --all --group --header --group-directories-first --tree --level LEVEL +ltaa => --all --binary --all --group --header --group-directories-first --tree --level 2 ---------aa--------- ------------------------------lt-------------------------------- ``` diff --git a/conf.d/fish-eza.fish b/conf.d/fish-eza.fish index 545ef78..7ae4647 100644 --- a/conf.d/fish-eza.fish +++ b/conf.d/fish-eza.fish @@ -1,5 +1,5 @@ function __fish_eza_install --on-event fish-eza_install - set -Ux __FISH_EZA_BASE_ALIASES l ll lg le lt lc lo + set -Ux __FISH_EZA_BASE_ALIASES l ll lg le ls lt lc lo set -Ux __FISH_EZA_EXPANDED a d i id aa ad ai aid aad aai aaid set -Ux __FISH_EZA_EXPANDED_OPT_NAME LA LD LI LID LAA LAD LAI LAID LAAD LAAI LAAID set -Ux __FISH_EZA_OPT_NAMES @@ -13,7 +13,8 @@ function __fish_eza_install --on-event fish-eza_install set -Ux EZA_LL_OPTIONS "--long" set -Ux EZA_LG_OPTIONS "--git" "--git-ignore" "--long" set -Ux EZA_LE_OPTIONS "--extended" "--long" - set -Ux EZA_LT_OPTIONS "--tree" "--level" + set -Ux EZA_LS_OPTIONS + set -Ux EZA_LT_OPTIONS "--tree" "--level" "2" set -Ux EZA_LC_OPTIONS "--across" set -Ux EZA_LO_OPTIONS "--oneline"