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:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user