/
bashrc
63 lines (55 loc) · 1.96 KB
/
bashrc
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
PATH=/opt/local/bin:/opt/local/sbin:~/dotfiles/bin:$PATH
export PATH
export EDITOR=vim
export PAGER=w3m
export COWPATH=/opt/local/share/cowsay/cows/
export LDFLAGS=-L/opt/local/lib/
export LESS=-R
alias grep="grep --color=auto"
# force utf-8 encoding for pbpaste/pbcopy (and others?)
export __CF_USER_TEXT_ENCODING=0x1F5:0x8000100:0x8000100
export EMAIL=dgilman@gilslotd.com
function dgilman_git_status {
GIT_BRANCH=$(git branch --no-color 2>/dev/null | sed -n 's/^\* \(.*\)$/\1/p')
GIT_TAG=$(git describe --tag 2>/dev/null)
GIT_DIRTY=$(git status --porcelain 2>/dev/null | grep -v "^??")
GIT_STRING=""
if [ ! -z "$GIT_BRANCH" ]; then
GIT_STRING=" ""$GIT_STRING""$GIT_BRANCH"
if [ ! -z "$GIT_TAG" ]; then
GIT_STRING="$GIT_STRING"" @ ""$GIT_TAG"
fi
if [ ! -z "$GIT_DIRTY" ]; then
GIT_STRING="$GIT_STRING"" d "
fi
fi
echo -n "$GIT_STRING"
}
if [ "$(id -u)" != "0" ]; then
PS1='\[\033[35m\]`date +'%H:%M'`.${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(dgilman_git_status)\$ '
else
PS1='\[\033[31m\]`date +'%H:%M'`.${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(dgilman_git_status)\$ '
fi
alias w3m='w3m -F -cookie'
#alias man='w3mman' # mysteriously broken on dar.local
#alias git='/Users/david/bin/git-achievements'
alias sprunge="curl -F 'sprunge=<-' http://sprunge.us"
export MANPATH=$MANPATH:/opt/local/man
#source ~/.gitcompletion.sh
#debian!?!?
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export TZ=America/Chicago
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi