2013-06-08 22:32:09 +02:00
|
|
|
#
|
|
|
|
# ~/.bashrc
|
|
|
|
#
|
|
|
|
|
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
2014-10-03 10:26:45 +02:00
|
|
|
# OS-specific things
|
|
|
|
if [[ "$OSTYPE" =~ ^darwin.*$ ]]; then
|
2014-10-30 08:37:09 +01:00
|
|
|
PATH=$(brew --prefix coreutils)/libexec/gnubin:/usr/local/sbin:$PATH
|
2014-10-08 19:47:19 +02:00
|
|
|
|
2014-10-29 15:11:25 +01:00
|
|
|
if [[ -f $(brew --prefix)/etc/bash_completion ]]; then
|
2014-10-08 19:47:19 +02:00
|
|
|
. $(brew --prefix)/etc/bash_completion
|
|
|
|
fi
|
2014-10-03 10:26:45 +02:00
|
|
|
fi
|
|
|
|
|
2013-06-08 22:32:09 +02:00
|
|
|
# Aliases
|
2013-07-15 15:27:51 +02:00
|
|
|
alias ls='ls -F --color=auto'
|
2014-10-29 14:40:03 +01:00
|
|
|
alias less='less -R' # preserves colors in GNU coreutils' `less`
|
2013-06-08 22:32:09 +02:00
|
|
|
|
|
|
|
# Environment
|
|
|
|
PS1='[\u@\h: \w]\$ '
|
2013-06-14 11:40:28 +02:00
|
|
|
export EDITOR=/usr/bin/vim
|
|
|
|
export PAGER=/usr/bin/less
|
2013-06-18 14:05:37 +02:00
|
|
|
# sequence to set the terminal title to "user@hostname: pwd"
|
2014-05-18 12:05:35 +02:00
|
|
|
TITLEBAR='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
|
2014-05-17 21:34:12 +02:00
|
|
|
# ignore commands starting with space and duplicates
|
|
|
|
HISTCONTROL=ignoreboth
|
2014-05-17 21:32:20 +02:00
|
|
|
# ignore common commands in bash history
|
|
|
|
HISTIGNORE='ls:bg:fg:history'
|
2014-09-15 20:28:06 +02:00
|
|
|
PROMPT_COMMAND="$TITLEBAR"
|
2013-06-08 22:32:09 +02:00
|
|
|
|
2014-10-05 13:15:48 +02:00
|
|
|
# look for Ansible hosts file in current directory
|
2014-10-05 13:43:13 +02:00
|
|
|
export ANSIBLE_HOSTS=hosts
|
2014-10-05 13:15:48 +02:00
|
|
|
|
2014-10-05 13:31:08 +02:00
|
|
|
# look for Node binaries in current directory
|
2014-10-05 13:34:47 +02:00
|
|
|
# if we have npm, we probably want to use npm binaries
|
|
|
|
# I don't like installing globally (npm -g), so add local
|
|
|
|
# node modules' bin to PATH
|
2015-03-13 09:25:26 +01:00
|
|
|
command -v npm >/dev/null 2>&1
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
export PATH=$PATH:node_modules/.bin
|
2014-10-05 13:34:47 +02:00
|
|
|
fi
|
2014-10-05 13:31:08 +02:00
|
|
|
|
2013-06-08 22:32:09 +02:00
|
|
|
# If a private bin directory exists, add it to PATH
|
|
|
|
[[ -d ~/bin ]] && PATH="$PATH:~/bin"
|
|
|
|
|
2014-10-03 10:26:45 +02:00
|
|
|
# solarized dircolors (needs coreutils from homebrew on Mac OS X)
|
2013-06-08 22:32:09 +02:00
|
|
|
[[ -r ~/.dircolors.ansi-dark ]] && eval `dircolors ~/.dircolors.ansi-dark`
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
# Don't exit when accidentally pressing ^D
|
|
|
|
set -o ignoreeof
|
|
|
|
|
|
|
|
# Append, rather than overwrite history files
|
|
|
|
# Useful for when multiple bash sessions are running
|
|
|
|
shopt -s histappend
|
2013-06-17 16:59:51 +02:00
|
|
|
|
|
|
|
# check the window size after each command and, if necessary,
|
|
|
|
# update the values of LINES and COLUMNS.
|
|
|
|
shopt -s checkwinsize
|
2014-10-05 13:31:08 +02:00
|
|
|
|
|
|
|
export PATH
|