Skip to content

Instantly share code, notes, and snippets.

@modulitos
Created October 17, 2014 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modulitos/254994d9ea140c04104d to your computer and use it in GitHub Desktop.
Save modulitos/254994d9ea140c04104d to your computer and use it in GitHub Desktop.
.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