1
0

Make OS X ls color scheme similar to Linux

This commit is contained in:
Noah 2016-01-13 11:59:14 -08:00
parent 6b59f379b6
commit cc39166555
2 changed files with 11 additions and 4 deletions

View File

@ -21,6 +21,10 @@ export PATH="/usr/sbin:/sbin:/usr/bin:/bin:$HOME/bin:$HOME/go/bin"
if [[ $platform == "darwin" ]]; then if [[ $platform == "darwin" ]]; then
# Prefer /usr/local/bin because homebrew # Prefer /usr/local/bin because homebrew
export PATH="/usr/local/bin:$PATH" export PATH="/usr/local/bin:$PATH"
# Enable colors and set a similar color scheme as Linux (see `man ls`)
export CLICOLOR=1
export LSCOLORS="ExGxcxdxcxegedabagecec"
else else
export PATH="$PATH:/usr/local/bin:/usr/local/sbin" export PATH="$PATH:/usr/local/bin:/usr/local/sbin"
fi fi
@ -78,9 +82,6 @@ elif [ "$TERM" = 'cygwin' ]; then
ENLIGHTENED=1 ENLIGHTENED=1
fi fi
# Make Mac OS X show colors in the `ls` command.
export CLICOLOR=1
# Custom bash prompt. # Custom bash prompt.
git_branch() { git_branch() {
branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' | perl -pe 's/^\*\s+//g'` branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' | perl -pe 's/^\*\s+//g'`

View File

@ -9,7 +9,6 @@ export LANG=en_US.UTF-8 # Unicode
setopt prompt_subst # Allow for dynamic prompts setopt prompt_subst # Allow for dynamic prompts
autoload -U colors && colors # Get color aliases autoload -U colors && colors # Get color aliases
autoload -U compinit && compinit # Better tab completion autoload -U compinit && compinit # Better tab completion
export CLICOLOR=1 # Colors in `ls` on Mac OS
export HISTSIZE=2000 # History settings export HISTSIZE=2000 # History settings
export HISTFILE="$HOME/.history" export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE export SAVEHIST=$HISTSIZE
@ -21,6 +20,13 @@ setopt nobeep
# 256 colors # 256 colors
[[ "$TERM" == "xterm" ]] && export TERM=xterm-256color [[ "$TERM" == "xterm" ]] && export TERM=xterm-256color
# CLI colors under OS X for `ls`
if [[ `uname` == "Darwin" ]]; then
# Enable colors and set a similar scheme as on Linux (see `man ls`)
export CLICOLOR=1
export LSCOLORS="ExGxcxdxcxegedabagecec"
fi
# Normalize the PATH # Normalize the PATH
CORE_PATH="/usr/sbin:/sbin:/usr/bin:/bin" CORE_PATH="/usr/sbin:/sbin:/usr/bin:/bin"
USR_PATH="/usr/local/sbin:/usr/local/bin:${HOME}/bin:${HOME}/go/bin:${HOME}/android/sdk/platform-tools" USR_PATH="/usr/local/sbin:/usr/local/bin:${HOME}/bin:${HOME}/go/bin:${HOME}/android/sdk/platform-tools"