Tidied the .bashrc file.

This commit is contained in:
Scott Wallace 2014-11-11 21:13:52 +00:00
parent 1b59ccf35f
commit 0a02eb02f0

29
.bashrc
View file

@ -1,16 +1,28 @@
#--------------------------------------------------------------------------------
# The best editor # The best editor
#--------------------------------------------------------------------------------
export EDITOR=vi export EDITOR=vi
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Update the path with local overrides # Update the path with local overrides
#--------------------------------------------------------------------------------
export PATH=/usr/local/bin:/usr/local/sbin:${PATH} export PATH=/usr/local/bin:/usr/local/sbin:${PATH}
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# A useful prompt
#--------------------------------------------------------------------------------
export PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Record history for longer and more dynamically
#--------------------------------------------------------------------------------
# Large history buffer # Large history buffer
export HISTSIZE=9999 export HISTSIZE=9999
export HISTFILESIZE=9999 export HISTFILESIZE=9999
# A useful prompt
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
# Avoid duplicates in the history... # Avoid duplicates in the history...
export HISTCONTROL=ignoredups:erasedups export HISTCONTROL=ignoredups:erasedups
@ -19,17 +31,25 @@ shopt -s histappend
# After each command, save and reload history # After each command, save and reload history
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Make OS X's 'top' behave like the GNU one # Make OS X's 'top' behave like the GNU one
#--------------------------------------------------------------------------------
alias top='top -u' alias top='top -u'
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Git aliases # Git aliases
#--------------------------------------------------------------------------------
alias githistory='git log --oneline --abbrev-commit --all --graph --decorate' alias githistory='git log --oneline --abbrev-commit --all --graph --decorate'
alias gitx='open -a GitX .' alias gitx='open -a GitX .'
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Add bash completion for ssh: it tries to complete the host to which you # Add bash completion for ssh: it tries to complete the host to which you
# want to connect from the list of the ones contained in ~/.ssh/known_hosts # want to connect from the list of the ones contained in ~/.ssh/known_hosts
#--------------------------------------------------------------------------------
__ssh_known_hosts() { __ssh_known_hosts() {
if [[ -f ~/.ssh/known_hosts ]]; then if [[ -f ~/.ssh/known_hosts ]]; then
cut -d " " -f1 ~/.ssh/known_hosts | cut -d "," -f1 cut -d " " -f1 ~/.ssh/known_hosts | cut -d "," -f1
@ -50,3 +70,4 @@ _ssh() {
complete -o bashdefault -o default -o nospace -F _ssh ssh 2>/dev/null \ complete -o bashdefault -o default -o nospace -F _ssh ssh 2>/dev/null \
|| complete -o default -o nospace -F _ssh ssh || complete -o default -o nospace -F _ssh ssh
#--------------------------------------------------------------------------------