Skip to content

Instantly share code, notes, and snippets.

@modulitos modulitos/.bashrc
Created Oct 17, 2014

Embed
What would you like to do?
.bashrc (remote)
# Set colorful prompt
# export PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] '
# export PROMPT_DIRTRIM=2
export MYPS='$(echo -n "${PWD/#$HOME/~}" | awk -F "/" '"'"'{if (length($0) > 20) { if (NF>4) print $1 "/" $2 "/.../" $(NF-1) "/" $NF; else if (NF>3) print $1 "/" $2 "/.../" $NF; else print $1 "/.../" $NF; } else print $0;}'"'"')'
case "$TERM" in
"dumb")
PS1="> "
;;
xterm*|rxvt*|eterm*|screen*)
PS1='\[\e[1;32m\][\u@\h]$(eval "echo ${MYPS}")$\[\e[0m\] '
;;
*)
PS1="> "
;;
esac
# Allow multi-color terminal (used with lean-mean .vim repo)
alias tmux='tmux -2'
# export TERM=screen-256color
# if [ -n "$DISPLAY" -a "$TERM" == "screen" ]; then
if [ "$TERM" == "screen" ]; then
export TERM=screen-256color
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.