From 258fbfc275556405fd93e2aec5608d9a6e70ff1e Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 12 Mar 2024 13:50:09 +0100 Subject: [PATCH] Fix ls --- config/aliases.nu | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/aliases.nu b/config/aliases.nu index 7caecb0..6b5a179 100644 --- a/config/aliases.nu +++ b/config/aliases.nu @@ -33,22 +33,22 @@ def _ls_format_mode [mode: string] { } # quick and easy ls -def ls [dir?: string] { - let output = (if $dir == null { _ls } else { _ls (glob $dir) }) | sort-by type name -i +def ls [dir?] { + let output = (if $dir == null { _ls } else { _ls $dir }) | sort-by type name -i if ($output | length) == 0 { "" | cat } else { $output | grid -c -s " " | cat } } # ls with hidden files -def la [dir?: string] { - (if $dir == null { _ls -al } else { _ls -al (glob $dir) }) +def la [dir?] { + (if $dir == null { _ls -al } else { _ls -al $dir }) | sort-by type name -i | each { $in | update mode (_ls_format_mode $in.mode) } | select mode name target user size modified } # ls with details -def ll [dir?: string] { - (if $dir == null { _ls -l } else { _ls -l (glob $dir) }) +def ll [dir?] { + (if $dir == null { _ls -l } else { _ls -l }) | each { $in | update mode (_ls_format_mode $in.mode) } | sort-by type name -i | select mode name target user size modified