refactor: consolidate and expand ls function family

- Upgrade ls to long listing (-l -a) and drop the standalone l and lS functions in favor of abbreviations
- Remove llm (ambiguous name, redundant with ltr)
- Add lsr (reversed time oneline), lss (size-sorted), lD (dirs-only), lx (extension-sorted)
- Enhance ltr with --all and age color-scale gradient
- Wire up ls abbreviations: l, lS, lsR, lX, lT, lsT
- Update README functions table and add Listing abbreviations section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 13:21:05 -04:00
parent 636c31bf9e
commit bc9cbb22fc
11 changed files with 85 additions and 47 deletions
+17 -5
View File
@@ -180,12 +180,13 @@ rm -f file.txt # Falls through to standard rm -f
| Function | Description |
|---|---|
| `l` | `eza` — long listing, all files, git status and header |
| `ls` | `eza`with icons, color, and hyperlinks |
| `ls` | `eza` — long listing, all files, icons, color, hyperlinks |
| `lss` | `eza`size-sorted long listing with gradient color scale |
| `lsr` | `eza` — reversed time-sorted oneline listing |
| `ltr` | `eza` — long listing, reversed modification time, age color scale |
| `lD` | `eza` — directories only |
| `lx` | `eza` — long listing sorted by extension |
| `lt` | `eza` — tree listing, depth 2 |
| `ltr` | `eza` — long listing, reversed modification time |
| `lS` | `eza` — size-sorted listing |
| `llm` | `eza` — long listing sorted by modification time |
| `lstree` | `eza` — full recursive tree |
### Git
@@ -303,6 +304,17 @@ Abbreviations expand in-place as you type, keeping your history clean.
| `v` | `antigravity` (VSCode-equivalent) |
| `k` | `kate` |
### Listing
| Abbr | Expands To |
|---|---|
| `l` | `ls` |
| `lS` | `lss` (size-sorted) |
| `lsR` | `lsr` (reversed time) |
| `lX` | `lx` (extension-sorted) |
| `lT` | `lt` (tree, depth 2) |
| `lsT` | `lstree` (full tree) |
### Navigation
| Abbr | Expands To |
+15 -1
View File
@@ -65,6 +65,21 @@ abbr -a ag. antigravity .
abbr -a :q kitty @ close-window # Kitty (Closes the active split/pane)
abbr -a :Q kitty @ close-tab # Kitty (Closes the whole tab)
######### Alternates ##########
### ls alternates
# List all files
abbr -a l ls
# List all files by size
abbr -a lS lss
# List all files by reverse modified time
abbr -a lsR lsr
# List by extension
abbr -a lX lx
# Tree listing (depth 2)
abbr -a lT lt
# Full tree listing
abbr -a lsT lstree
# Window Creation (OS Windows)
# abbr -a :w wezterm cli spawn --new-window # WezTerm
abbr -a :w kitty @ launch --type=os-window # Kitty
@@ -217,4 +232,3 @@ abbr -a scr 'systemctl restart'
abbr -a ssct 'sudo systemctl status'
abbr -a sscs 'sudo systemctl start'
abbr -a sscr 'sudo systemctl restart'
-12
View File
@@ -1,12 +0,0 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function l --description 'Long listing, all files'
if which eza >/dev/null 2>&1
eza --all --long --git --header --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd --almost-all --long --git --header --hyperlink=auto $argv
else
command ls --color=auto --almost-all -l $argv
end
end
+12
View File
@@ -0,0 +1,12 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function lD --description 'List directories only'
if which eza >/dev/null 2>&1
eza --only-dirs --long --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd --only-dirs --long --hyperlink=auto $argv
else
command ls --color=auto -d -- */ $argv
end
end
-12
View File
@@ -1,12 +0,0 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function lS --description 'Size-sorted listing'
if which eza >/dev/null 2>&1
eza --sort=size --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd --oneline --classic $argv
else
command ls $argv
end
end
-12
View File
@@ -1,12 +0,0 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function llm --description 'Long listing sorted by modification time'
if which eza >/dev/null 2>&1
eza --long --sort=modified --git --header --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd --timesort --long --git --header --hyperlink=auto $argv
else
command ls --color=auto -lt $argv
end
end
+3 -3
View File
@@ -1,12 +1,12 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function ls --description 'List files'
function ls --description 'List all files'
if which eza >/dev/null 2>&1
eza --oneline --icons --color=auto --hyperlink $argv
eza -l -a --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd --hyperlink=auto $argv
lsd -l -a --hyperlink=auto $argv
else
command ls --color=auto $argv
end
+12
View File
@@ -0,0 +1,12 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function lsr --description 'Reversed time-sorted listing'
if which eza >/dev/null 2>&1
eza --oneline --sort=modified --reverse --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd -ltr $argv
else
command ls --color=auto -ltr $argv
end
end
+12
View File
@@ -0,0 +1,12 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function lss --description 'Size-sorted listing'
if which eza >/dev/null 2>&1
eza --oneline --long --all --sort=size --icons --color=auto --hyperlink --color-scale=size --color-scale-mode=gradient $argv
else if which lsd >/dev/null 2>&1
lsd --oneline --long --all --sort=size --reverse --color=auto --hyperlink=always $argv
else
command ls $argv
end
end
+2 -2
View File
@@ -3,9 +3,9 @@
function ltr --description 'Reversed time-sorted listing'
if which eza >/dev/null 2>&1
eza --long --sort=modified --reverse --icons --color=auto --hyperlink $argv
eza --long --all --sort=modified --reverse --icons --hyperlink --color=auto --color-scale=age --color-scale-mode=gradient $argv
else if which lsd >/dev/null 2>&1
lsd -ltr $argv
lsd --long --all --sort=time --reverse --color=auto --hyperlink=always $argv
else
command ls --color=auto -ltr $argv
end
+12
View File
@@ -0,0 +1,12 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function lx --description 'Extension-sorted listing'
if which eza >/dev/null 2>&1
eza --long --all --sort=extension --icons --color=auto --hyperlink $argv
else if which lsd >/dev/null 2>&1
lsd --long --all --sort=extension --hyperlink=auto $argv
else
command ls --color=auto -lX $argv
end
end