bashrc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bashrc [2009/05/16 15:03] – andi | bashrc [2010/04/28 18:45] (current) – 92.195.193.18 | ||
---|---|---|---|
Line 3: | Line 3: | ||
This is my '' | This is my '' | ||
- | <code bash> | + | <code bash bashrc> |
# Andi's .bashrc | # Andi's .bashrc | ||
Line 29: | Line 29: | ||
alias ll='ls -l' | alias ll='ls -l' | ||
alias la='ls -A' | alias la='ls -A' | ||
- | alias l='ls -la' | + | alias l='ls -la' |
+ | export GREP_OPTIONS=' | ||
# color in man pages http:// | # color in man pages http:// | ||
Line 47: | Line 48: | ||
# cleanup firefox 3 dbs | # cleanup firefox 3 dbs | ||
alias ffclean=' | alias ffclean=' | ||
+ | |||
+ | # current git branch for prompt below | ||
+ | # http:// | ||
+ | parse_git_branch() { | ||
+ | git branch 2> /dev/null | sed -e '/ | ||
+ | } | ||
+ | # has current branch unrecorded changes? | ||
+ | # http:// | ||
+ | parse_git_dirty() { | ||
+ | git diff --quiet HEAD &>/ | ||
+ | [[ $? == 1 ]] && echo " | ||
+ | } | ||
# set a fancy prompt and xterm title | # set a fancy prompt and xterm title | ||
shopt -s checkwinsize | shopt -s checkwinsize | ||
- | if [ ! -z "$COLORTERM" ]; then | + | if [ " |
if [ " | if [ " | ||
- | PS1="\[\033]2;\w\007\]\[\033[0;31m\]\u@\h:\w\\$\[\033[0;37m\] " | + | PS1='\[\e[0;31m\]\u@\h\[\e[0;35m\]$(parse_git_branch)$(parse_git_dirty)\[\e[0;31m\]:\w\$\[\e[0m\] ' |
else | else | ||
- | PS1="\[\033]2;\w\007\]\[\033[0;32m\]\u@\h:\w\\$\[\033[0;37m\] " | + | PS1='\[\e[0;32m\]\u@\h\[\e[0;35m\]$(parse_git_branch)$(parse_git_dirty)\[\e[0;32m\]:\w\$\[\e[0m\] ' |
fi | fi | ||
else | else | ||
Line 65: | Line 79: | ||
fi | fi | ||
- | # ssh keymanager - see http://notes.splitbrain.org/ | + | # ssh keymanager - see http://wiki.splitbrain.org/ |
- | if [ -e / | + | if [ -e / |
keychain -q ~/ | keychain -q ~/ | ||
if [ -e ~/ | if [ -e ~/ | ||
Line 75: | Line 89: | ||
fi | fi | ||
fi | fi | ||
- | # use zssh if available | ||
- | if [ -e / | ||
# daily temp dir | # daily temp dir | ||
Line 88: | Line 100: | ||
unset td | unset td | ||
} | } | ||
+ | |||
+ | # set a sane editor | ||
+ | if [ -e / | ||
+ | export EDITOR=/ | ||
+ | alias vi=/ | ||
+ | fi | ||
# print a fortune cookie | # print a fortune cookie | ||
if which fortune >/ | if which fortune >/ | ||
- | if [ -z " | + | if [ " |
- | fortune -a -s | + | |
- | else | + | |
echo -en " | echo -en " | ||
fortune -a -s | fortune -a -s | ||
echo -en " | echo -en " | ||
+ | else | ||
+ | fortune -a -s | ||
fi | fi | ||
fi | fi |
bashrc.1242486182.txt.gz · Last modified: 2009/05/16 15:03 by andi