Created
April 9, 2016 17:02
-
-
Save jaseg/880d09480f5b4abea69381c89a65e8ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment