]> git.donarmstrong.com Git - dak.git/blob - config/homedir/.bashrc
881e7303420b099c8846ade804ed87ff6e0aab77
[dak.git] / config / homedir / .bashrc
1 # bashrc for dak user
2
3 # If not running interactively, don't do anything
4 [ -z "$PS1" ] && return
5
6
7 # append to the history file, don't overwrite it
8 shopt -s histappend
9 export HISTCONTROL=ignoreboth
10
11 # check the window size after each command and, if necessary,
12 # update the values of LINES and COLUMNS.
13 shopt -s checkwinsize
14
15 # make less more friendly for non-text input files, see lesspipe(1)
16 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
17
18 ## A little nice prompt.
19 PS1='`_ret=$?; if test $_ret -ne 0; then echo "\[\033[01;31m\]$_ret "; set ?=$_ret; unset _ret; fi`\[\033[01;33m\][`git branch 2>/dev/null|cut -f2 -d\* -s` ] \[\033[01;32m\]\u@\[\033[00;36m\]\h\[\033[01m\]:\[\033[00;37m\]\w\[\033[00m\]\$ '
20
21 # If this is an xterm set the title to user@host:dir
22 case "$TERM" in
23 xterm*|rxvt*)
24     PS1="\[\e]0;\u@\h: \w\a\]$PS1"
25     ;;
26 *)
27     ;;
28 esac
29
30 case "$HOSTNAME" in
31     franck)
32         export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
33         ;;
34     morricone)
35         export SCRIPTVARS=/srv/backports-master.debian.org/dak/config/backports/vars
36         ;;
37     chopin)
38         export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars
39         ;;
40     *)
41         echo "Unconfigured dak host, not importing the usual vars"
42         ;;
43 esac
44
45 . $SCRIPTVARS
46
47 function emacs() {
48     export EDITOR=$(which emacs)
49 }
50
51 export PAGER=less
52 export LESS="-X"
53 export EDITOR=$(which vim)
54 export HISTFILESIZE=6000
55 export GREP_OPTIONS="--color=auto"
56 export CDPATH=".:~:${base}:${public}:${queuedir}"
57 export PATH="~/bin/:${PATH}"
58
59 alias base='cd ${base}'
60 alias config='cd ${configdir}'
61 alias psql='LD_PRELOAD=/lib/libreadline.so.5 psql'