dotfiles/dotfiles/bashrc

65 lines
1.7 KiB
Bash
Raw Normal View History

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
PATH=$(brew --prefix coreutils)/libexec/gnubin:/usr/local/sbin:$PATH
if [[ -f $(brew --prefix)/etc/bash_completion ]]; then
. $(brew --prefix)/etc/bash_completion
fi
2014-10-03 10:26:45 +02:00
fi
2013-06-08 22:32:09 +02:00
# Aliases
alias ls='ls -F --color=auto'
alias less='less -R' # preserves colors in GNU coreutils' `less`
2013-06-08 22:32:09 +02:00
# Environment
PS1='[\u@\h: \w]\$ '
export EDITOR=/usr/bin/vim
export PAGER=/usr/bin/less
# sequence to set the terminal title to "user@hostname: pwd"
TITLEBAR='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ignore commands starting with space and duplicates
HISTCONTROL=ignoreboth
# ignore common commands in bash history
HISTIGNORE='ls:bg:fg:history'
PROMPT_COMMAND="$TITLEBAR"
2013-06-08 22:32:09 +02:00
# look for Ansible hosts file in current directory
export ANSIBLE_HOSTS=hosts
# look for Node binaries in current directory
# 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
command -v npm >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
export PATH=$PATH:node_modules/.bin
fi
2013-06-08 22:32:09 +02:00
# If a private bin directory exists, add it to PATH
[[ -d ~/bin ]] && PATH="$PATH:~/bin"
2020-07-10 12:51:41 +02:00
# selenized dircolors
# see: https://github.com/jan-warchol/selenized/tree/master/other-apps/dircolors
export LS_COLORS="$LS_COLORS:ow=1;7;34:st=30;44:su=30;41"
2013-06-08 22:32:09 +02:00
# 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
export PATH