2013-02-23 05:38:12 -05:00
|
|
|
# [----------------------------------------------------------------------------]
|
|
|
|
# [----------------------------- PROMPT ---------------------------------------]
|
|
|
|
# [----------------------------------------------------------------------------]
|
|
|
|
hostn=$(hostname -s)
|
|
|
|
usern=$(whoami)
|
|
|
|
|
|
|
|
function prompt {
|
|
|
|
ctime=$(date +%T)
|
|
|
|
prmpt="[${PWD}][${ctime}]"
|
2013-02-24 16:20:59 -05:00
|
|
|
let FILLS=${COLUMNS}-${#prmpt}
|
2013-02-23 05:38:12 -05:00
|
|
|
LINE=""
|
|
|
|
|
|
|
|
if [[ "$PWD" =~ "/home/$usern" ]]; then
|
|
|
|
let FILLS=$FILLS+5+${#usern}
|
|
|
|
fi
|
|
|
|
|
|
|
|
for (( f=0; f<$FILLS; f++ ))
|
|
|
|
do
|
2013-02-23 14:16:31 -05:00
|
|
|
LINE=$LINE"\e[0;34;44m-"
|
2013-02-23 05:38:12 -05:00
|
|
|
done
|
|
|
|
|
2013-02-23 14:16:31 -05:00
|
|
|
PS1="\e[44;1;37m[\t] \w ${LINE}\e[0m\n"
|
2013-02-23 05:38:12 -05:00
|
|
|
if [ "$SSH_CONNECTION" == "" ]; then
|
2013-02-23 14:16:31 -05:00
|
|
|
PS1="$PS1\[\e[1;32;40m\][\u@\h]"
|
2013-02-23 05:38:12 -05:00
|
|
|
else
|
2013-02-25 14:53:12 -05:00
|
|
|
PS1="$PS1\[\e[1;33;40m\][\u@\h]"
|
2013-02-23 05:38:12 -05:00
|
|
|
fi
|
2013-02-23 14:16:31 -05:00
|
|
|
PS1="$PS1\$(if [ \$? = 0 ]; then echo -e \"\$\"; else echo -e \"\[\e[0;31m\]\$\"; fi)\[\e[0m\] "
|
2013-02-23 05:38:12 -05:00
|
|
|
}
|
|
|
|
PROMPT_COMMAND=prompt
|
|
|
|
|
|
|
|
# [----------------------------------------------------------------------------]
|
|
|
|
# [----------------------------- ALIAS ---------------------------------------]
|
|
|
|
# [----------------------------------------------------------------------------]
|
2013-02-24 16:20:59 -05:00
|
|
|
|
2012-04-05 05:39:31 -04:00
|
|
|
# Common parameters
|
2013-02-24 16:20:59 -05:00
|
|
|
alias ls='ls -v --color=auto'
|
|
|
|
alias ll='ls -lavh'
|
|
|
|
alias grep='grep --color'
|
2012-04-05 05:39:31 -04:00
|
|
|
|
2013-04-01 14:16:35 -04:00
|
|
|
# Seems like a better idea than it actually is?
|
|
|
|
#alias sudo='sudo env PATH=$PATH'
|
2012-08-14 14:26:28 -04:00
|
|
|
|
2013-04-01 14:16:35 -04:00
|
|
|
# move around
|
2013-02-24 16:20:59 -05:00
|
|
|
alias ..='cd ..'
|
|
|
|
alias ...='cd ../..'
|
|
|
|
alias ....='cd ../../..'
|
|
|
|
|
|
|
|
# for git
|
|
|
|
alias get='git'
|
|
|
|
alias ga='git add'
|
|
|
|
alias gaa='git add .'
|
|
|
|
alias gs='git status'
|
|
|
|
alias gl='git log'
|
|
|
|
alias gcm='git commit -m'
|
|
|
|
alias gcf='git commit -F'
|
|
|
|
|
2013-04-01 14:16:35 -04:00
|
|
|
# random
|
|
|
|
alias calc='bc <<<'
|
|
|
|
|
2013-02-23 05:38:12 -05:00
|
|
|
# [----------------------------------------------------------------------------]
|
|
|
|
# [------------------------------ OTHER ---------------------------------------]
|
|
|
|
# [----------------------------------------------------------------------------]
|
2012-04-05 05:39:31 -04:00
|
|
|
# Case insensitive matching
|
2012-05-15 14:50:49 -04:00
|
|
|
shopt -s nocaseglob
|
2012-07-19 15:39:23 -04:00
|
|
|
|
2013-02-23 05:38:12 -05:00
|
|
|
# [----------------------------------------------------------------------------]
|
|
|
|
# [------------------------------ PATH ----------------------------------------]
|
|
|
|
# [----------------------------------------------------------------------------]
|
2012-11-30 13:36:26 -05:00
|
|
|
PATH=$PATH:$HOME/bin
|