summaryrefslogtreecommitdiff
path: root/bashrc
blob: f415b5c46a2bcb8096accdc1e876e3915d40585c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if [[ $- != *i* ]]; then
	return
fi

shopt -s checkwinsize
shopt -s histappend

case ${TERM} in
	xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix)
		PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
		;;
	screen*)
		PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
		;;
esac

if [[ $(tput colors) -ge 8 ]]; then
	eval $(dircolors -b)

	if [[ ${EUID} == 0 ]]; then
		PS1='\[\033[01;31m\]\h\[\033[01;34m\] \w \$\[\033[00m\] '
	else
		PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
	fi

	alias ls='ls --color=auto'
	alias grep='grep --colour=auto'
	alias egrep='egrep --colour=auto'
	alias fgrep='fgrep --colour=auto'
else
	PS1='\u@\h \w \$ '
fi

export EDITOR=vim
export HISTSIZE=50000

rpath() { source <(~/dev/rpath/rpath.sh "${@}"); }
alias rp='rpath'