Make the ls color available for macos

pull/2082/head
Gurkirat Singh 2022-02-08 14:27:48 +05:30 committed by GitHub
parent 4dbe92e38d
commit 2b8928f2bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -1,13 +1,18 @@
cite about-alias
about-alias 'general aliases'
if ls --color -d . &> /dev/null
then
alias ls="ls --color=auto"
elif ls -G -d . &> /dev/null
then
alias ls='ls -G' # Compact view, show colors
fi
# color support for darwin and non-darwin os
# special thanks https://stackoverflow.com/a/27776822/10362396
case "$(uname -s)" in
Darwin)
alias ls='ls -G'
;;
*)
alias ls='ls --color=auto'
;;
esac
# List directory contents
alias sl=ls