# --- preferences # load standard environment variables . $HOME/.shenv # don't put duplicate lines in the history. See bash(1) for more options export HISTCONTROL=ignoredups # ... and ignore same sucessive entries. export HISTCONTROL=ignoreboth # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" # if this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' ;; *) ;; esac # enable power-completion (shouldn't be necessary) if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi shopt -s globstar # --- colours originally from gentoo's default bashrc use_color=false safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM match_lhs="" [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(/dev/null \ && match_lhs=$(dircolors --print-database) [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true if ${use_color} ; then # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 if type -P dircolors >/dev/null ; then if [[ -f ~/.dir_colors ]] ; then eval $(dircolors -b ~/.dir_colors) elif [[ -f /etc/DIR_COLORS ]] ; then eval $(dircolors -b /etc/DIR_COLORS) fi fi PS1='\[\033[00;33m\]\h \[\033[00;32m\]\w \[\033[00;34m\]\$\[\033[00m\] ' alias ls='ls --color=auto' alias grep='grep --colour=auto' else PS1='\h \w \$ ' fi unset use_color safe_term match_lhs # --- aliases alias g='git' alias ga='git annex' alias workgit='cd ~/doc && git add . && git commit -a -m "work commit" --edit && git push origin master && cd ~/src/dotfiles && git push origin master' alias mg=$EDITOR alias fmr='MR_FAST=true mr'