From 7e5295d8ccc734d1039b8a0459d445d5636439d3 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Sat, 25 Apr 2015 23:08:16 +0200 Subject: Added better FreeBSD compatibility --- bash/.bashrc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'bash/.bashrc') diff --git a/bash/.bashrc b/bash/.bashrc index 7e7e1ab..5d2a601 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -12,7 +12,18 @@ export PATH="$PATH:$HOME/.local/bin" export PATH="$PATH:$HOME/.local/usr/bin" export PATH="$PATH:$HOME/.local/usr/local/bin" -alias ls='ls --color=auto' +case "$(uname)" in + Linux) + alias ls="ls --color=auto" + $usr="/usr" + ;; + FreeBSD) + alias ls="ls -G" + $usr="/usr/local" + ;; + *) + ;; +esac man() { env LESS_TERMCAP_mb=$'\E[01;31m' \ @@ -31,12 +42,12 @@ exists() { vim() { if [[ -z $@ ]]; then - /usr/bin/vim + $usr/bin/vim elif [[ -d $@ ]]; then dir=$(pwd) - cd $@ && /usr/bin/vim && cd $dir + cd $@ && $usr/bin/vim && cd $dir else - /usr/bin/vim $@ + $usr/bin/vim $@ fi } -- cgit v1.2.3