From 1afafd17e612efcd7f85b8809240e661b73113e0 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Fri, 3 Oct 2014 11:26:45 +0300 Subject: [PATCH] Fix some things for Mac OS X --- .bashrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index b502ff4..969476a 100644 --- a/.bashrc +++ b/.bashrc @@ -5,9 +5,15 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return +# OS-specific things +if [[ "$OSTYPE" =~ ^darwin.*$ ]]; then + PATH=$(brew --prefix coreutils)/libexec/gnubin:$PATH +else + alias less='less -R' # preserves colors in `less` +fi + # Aliases alias ls='ls -F --color=auto' -alias less='less -R' # preserves colors in `less` # Environment PS1='[\u@\h: \w]\$ ' @@ -24,7 +30,7 @@ PROMPT_COMMAND="$TITLEBAR" # If a private bin directory exists, add it to PATH [[ -d ~/bin ]] && PATH="$PATH:~/bin" -# solarized dircolors +# solarized dircolors (needs coreutils from homebrew on Mac OS X) [[ -r ~/.dircolors.ansi-dark ]] && eval `dircolors ~/.dircolors.ansi-dark` # Settings