### -*-bash-*- ### ### Bash session things. __mdw_shell=bash ## Only do this if we haven't done it before. (Note that this guard isn't ## exported, so subshells will need to make their own arrangements.) case ${__mdw_bashrc+t} in t) ;; *) __mdw_bashrc=t ## Fetch the common configuration. . "$HOME/.shell-rc" ## If we've not run the main profile yet, we should do that first. It sets ## up things we rely on. Also, if there's a system script, we should run ## that too. case ${__mdw_profile+t} in t) ;; *) . "$HOME/.profile" ;; esac __mdw_source_if_exists /etc/bashrc ## Completion. __mdw_source_if_exists /etc/bash_completion "$HOME/.bash_completion" ###-------------------------------------------------------------------------- ### Prompt hacking. __mdw_set_prompt_hacks () { case "$TERM" in linux*|screen*|xterm*|putty*|vt100*|eterm*) case "$(tput bold)" in "") bold="\[$(tput md)\]" unbold="\[$(tput me)\]" ;; *) bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" ;; esac gitcolour="\[$(tput setaf 6)\]" rccolour="\[$(tput setaf 1)\]" uncolour="\[$(tput op)\]" nl="\[ \]" ;; esac host='\h' dir=' \w' } __mdw_before_cmd_hack () { set -- $(history 1); shift __mdw_preexec "$*" } ## Only bother if the shell is interactive. if [ -t 0 ]; then PROMPT_DIRTRIM=5 __mdw_source_if_exists /usr/lib/git-core/git-sh-prompt __mdw_set_prompt_pieces PROMPT_COMMAND=__mdw_precmd PS0="\$(__mdw_before_cmd_hack)" fi ###-------------------------------------------------------------------------- ### Other shell tweaking. ## Random shell tweaks. notify=1 set -b shopt -u cdable_vars shopt -s cdspell shopt -s checkhash shopt -s checkwinsize shopt -s cmdhist shopt -u dotglob shopt -s expand_aliases shopt -s extglob if (( ${BASH_VERSINFO[0]} >= 4 )); then shopt -s globstar; fi shopt -s gnu_errfmt shopt -s histappend set -o histexpand shopt -s histreedit shopt -u histverify shopt -s hostcomplete shopt -s huponexit shopt -s interactive_comments shopt -s lithist shopt -u mailwarn shopt -u nocaseglob shopt -u nullglob shopt -s promptvars shopt -u shift_verbose shopt -s sourcepath HISTCONTROL=ignorespace:erasedups ###-------------------------------------------------------------------------- ### Finishing touches. ## Run any local hooks. __mdw_source_if_exists "$HOME/.bashrc-local" ###----- That's all, folks -------------------------------------------------- esac