Files
fish-config/functions/ltr.fish
T
rootiest 5c6691c32c fix: correct sort direction
Use reverse sorting by time for eza in `ltr` function.

Note: eza sorts oldest-to-newest by default, while lsd requires the
--reverse flag.
When the --reverse flag is used in eza the listing is done
newest-to-oldest which is not the intended direction.
2026-04-27 13:28:14 -04:00

13 lines
480 B
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function ltr --description 'Reversed time-sorted listing'
if which eza >/dev/null 2>&1
eza --long --all --sort=modified --icons --hyperlink --color=auto --color-scale=age --color-scale-mode=gradient $argv
else if which lsd >/dev/null 2>&1
lsd --long --all --sort=time --reverse --color=auto --hyperlink=always $argv
else
command ls --color=auto -ltr $argv
end
end