Skip to content

Instantly share code, notes, and snippets.

@hilios
Last active September 27, 2015 04:48
Show Gist options
  • Save hilios/1214175 to your computer and use it in GitHub Desktop.
Save hilios/1214175 to your computer and use it in GitHub Desktop.
Default configuration for bash
# ~/.bash_profile: executed by bash(1) for login shells.
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
# ~/.bashrc: executed by bash(1) for non-login shells.
export TERM=xterm-color
export LSCOLORS=DxGxcxdxCxegedabagacad
alias ls='ls -lahG'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias rehash='source ~/.bash_profile'
alias df='df -h'
alias du='du -h'
alias tf='tail -f'
alias less='less -r' # raw control characters
alias grep='egrep --color' # show differences in colour
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
function proml {
# Attribute{codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
# \[\e[01;36m\]
RESET="\[\017\]"
NORMAL="\[\033[0m\]"
RED="\[\033[0;31m\]"
YELLOW="\[\033[1;33m\]"
WHITE="\[\033[0;37m\]"
GREEN="\[\033[1;32m\]"
BLUE="\[\033[1;34m\]"
CYAN="\[\033[0;36m\]"
MAGENTA="\[\033[0;45m\]"
function git_branches {
git branch 2> /dev/null | sed -r 's/^\* (.+)/(\1)/g' | sed -r ':began N ; s/\n|\s{2,}/ /g ;b began '
}
function git_current_branch {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/\1/p'
}
function rvm_prompt {
~/.rvm/bin/rvm-prompt i v g
}
PS1="${GREEN}\u ${CYAN}\w ${YELLOW}git:\`git_current_branch\` ${NORMAL}\n$ "
export PS1
}
proml
umask 002
export PYTHONPATH="$PYTHONPATH:$HOME/.python/site-packages/" # Add Python PATH for scripting
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment