# ---------------------------------------------------------------------------- # # ----- More STATIC part ----------------------------------------------------- # # ---------------------------------------------------------------------------- # # If not running interactively, don't do anything [ -z "$PS1" ] && return # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # bash(1) for info and more options HISTCONTROL=ignoreboth # duplicated lines sequentially & starting with space HISTSIZE=10000 # number of commands remembered HISTFILESIZE=20000 # number of lines in history_file (truncate above) HISTTIMEFORMAT="[%a] %d-%b %H:%M | " # format for history command # check options: http://www.ss64.com/bash/shopt.html shopt -s histappend # append to the history file, don't overwrite it shopt -s checkwinsize # check window size and update $LINES and $COLUMNS. # see lesspipe(1) [ -x /usr/bin/lesspipe.sh ] && eval "$(SHELL=/bin/sh lesspipe.sh)" # all alias in ~/.bash_aliases # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi # ---------------------------------------------------------------------------- # # ----- New stuff usually goes here :-) -------------------------------------- # # ---------------------------------------------------------------------------- # function get_git_branch() { branch=`git branch -a 2> /dev/null | grep \* | cut -d' ' -f 2` eval "$1='$branch'" } PATH=$HOME/.local/bin:$PATH PATH=$PATH:$HOME/scripts EDITOR=vim BROWSER=firefox #LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:*.deb=90' PROMPT_COMMAND=' get_git_branch branch if [ "$branch" ] then branch="($branch) " fi default="\[$txtwht\] \W \[$txtylw\]$branch" if [ `whoami` == "root" ]; then PS1="\[$bldred\](\h)$default\[$bldred\]# \[$txtwht\]" else if [ $UNDER_JHBUILD ]; then PS1="\[$bldpur\](jhbuild)$default\[$bldgrn\]$ \[$txtwht\]" else PS1="\[$bldgrn\](\h)$default\[$bldgrn\]$ \[$txtwht\]" fi fi unset branch unset default ' # vim:ts=4:sw=4