这个东西基本不通用..
但是也提供一下. 因为很多时候. 习惯确实是习惯..
function get-host-name {
hostname|sed 's/^[0-9]*_//'
}
function git-branch-name {
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
}
function git-branch-prompt {
local branch=`git-branch-name`
if [ $branch ]; then printf "[%s]" $branch; fi
}
#PS1="[\u@\h]\[\033[0;36m\][\W]\[\033[0m\]\[\033[0;32m\]\$(git-branch-prompt)\[\033[0m\]\\\$ "
PS1="\[\033[0;31m\]$(get-host-name)>\[\033[0;36m\]\W>\[\033[0;32m\]\$(git-branch-prompt)\[\033[0m\]\\\$ "
export LANG=en_US.utf8 LC_ALL=en_US.utf8
export GOPATH=/root/gocode
export PATH=/root/gocode/bin:$PATH
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
alias cp='cp -i'
alias ds='du --max-depth=1|sort -n'
alias fomnitty='omnitty -T 80 -f'
alias grep='grep --color'
alias ll='ls -lh --color'
alias ls='ls --color'
alias mv='mv -i'
alias rm='rm -i --preserve-root'
alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
alias vi='vim'