1
0
Fork 0

more bash simplifications

This commit is contained in:
Von Random 2016-08-27 02:13:14 +03:00
parent 7159f9a8c2
commit c92a090d40

39
bashrc
View file

@ -14,6 +14,7 @@ dotfiles="${HOME}/vdotfiles"
#comp_enabled=true #comp_enabled=true
HISTSIZE=1000 HISTSIZE=1000
HISTFILE="${HOME}/.bash_history.${UID}"
HISTCONTROL=ignoredups:ignorespace HISTCONTROL=ignoredups:ignorespace
shopt -s histappend checkwinsize shopt -s histappend checkwinsize
[[ ${BASH_VERSINFO} -ge 4 ]] && shopt -s autocd [[ ${BASH_VERSINFO} -ge 4 ]] && shopt -s autocd
@ -91,8 +92,10 @@ alias ld='ls -lhda'
# diff and colordiff # diff and colordiff
if is_exec colordiff; then if is_exec colordiff; then
alias diff='command colordiff -u' alias diff='command colordiff -u'
else
alias diff='command diff -u'
fi fi
alias rdiff='diff -urx.svn' alias rdiff='diff -r'
# mount # mount
alias mountiso='sudo mount -t iso9660 -o loop' alias mountiso='sudo mount -t iso9660 -o loop'
@ -127,28 +130,18 @@ done
unset color_number unset color_number
reset='\[\e[0m\]' reset='\[\e[0m\]'
bold='\[\e[1m\]' bold='\[\e[1m\]'
prompt_host="${HOSTNAME}" if [[ ${USER} == 'von' ]]; then
prompt_bang=">${reset}" color_user="${nyellow}"
precmd() { else
if [[ -z ${hide_info} ]]; then color_user="${nred}"
prompt_cwd="${bold}${PWD}${reset}" fi
if [[ ${USER} != 'von' ]]; then if [[ $UID -eq 0 ]]; then
prompt_user="${bred}\u${reset} " color_bang="${nred}"
else else
prompt_user="${bold}\u${reset} " color_bang="${bold}"
fi fi
prompt_info="[ ${prompt_user}${prompt_host}:${prompt_cwd} ]" PS1="[ ${color_user}\u${reset} ${HOSTNAME}:${bold}${PWD}${reset} ]
else ${color_bang}>${reset} "
prompt_info=''
fi
if [[ $UID -eq 0 ]]; then
prompt_bang_color="${nred}"
else
prompt_bang_color="${bold}"
fi
PS1="${prompt_info}${newline}${prompt_bang_color}${prompt_bang} "
}
PROMPT_COMMAND='precmd'
# }}} # }}}
# {{{ key bindings # {{{ key bindings
# urxvt # urxvt