Add Linux color support when changing directories

This commit is contained in:
Michael Campagnaro 2014-09-29 21:54:25 -04:00
parent 50b1f41dc6
commit fb13f9cbee

8
zshrc
View File

@ -1,3 +1,5 @@
platform=`uname`
# Path to your oh-my-zsh configuration. # Path to your oh-my-zsh configuration.
ZSH=$HOME/.zsh ZSH=$HOME/.zsh
@ -17,7 +19,11 @@ bindkey "^N" insert-last-word
# Show contents of directory after cd-ing into it # Show contents of directory after cd-ing into it
chpwd() { chpwd() {
ls -lrthG if [[ $platform == 'Linux' ]]; then
ls -lrthG --color
elif [[ $platform == 'Darwin' ]]; then
ls -lrthG
fi
} }
# Unbreak broken, non-colored terminal # Unbreak broken, non-colored terminal