'lh' now function to accept parameters
dblume

dblume commited on 2024-01-17 15:41:55
Showing 1 changed files, with 4 additions and 3 deletions.

... ...
@@ -148,9 +148,10 @@ esac
148 148
 
149 149
 alias clip="expand | cut -b1-\$COLUMNS"
150 150
 
151
-# I'm often interested in the most recently changed file
152
-#alias lh="ls -lt | head -\$((\$(tput lines)*2/3))"
153
-alias lh="ls -lt | head -\$((\$LINES*2/3))"
151
+# I'm often interested in just the most recently changed file
152
+lh() {
153
+    ls --color=always -ltq "$@" | head -$(($LINES*2/3)) | tail --lines=+2
154
+}
154 155
 
155 156
 # For httpie: https://github.com/jakubroztocil/httpie#installation
156 157
 alias https='http --default-scheme=https'
157 158