From 16a7b26fd53731370708e30fc8fd81b5fc331e57 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 15 Aug 2022 18:31:22 +0200 Subject: Initial commit --- functions/cd.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 functions/cd.fish (limited to 'functions/cd.fish') diff --git a/functions/cd.fish b/functions/cd.fish new file mode 100644 index 0000000..53b8d45 --- /dev/null +++ b/functions/cd.fish @@ -0,0 +1,10 @@ +# Modified cd that also displays the directory's contents if the listing is less than 5 lines long +function cd + if test -n "$argv" + if test -e $argv -a ! -d (realpath $argv) + set argv (dirname $argv) + end + end + builtin cd $argv + and test (ls -C -w $COLUMNS |wc -l) -le 5; and ls +end -- cgit