1
0
Fork 0

a way to tell bash prompt from zsh, wip

This commit is contained in:
Von Random 2018-03-30 15:39:37 +03:00
parent 0e5d4de778
commit e9e42ae3ac

9
bashrc
View file

@ -5,7 +5,8 @@
HISTSIZE=1000 HISTSIZE=1000
HISTFILE="${HOME}/.bash_history.${UID}" HISTFILE="${HOME}/.bash_history.${UID}"
HISTCONTROL=ignoredups HISTCONTROL=ignoredups
shopt -s histappend checkwinsize autocd shopt -s histappend checkwinsize
((BASH_VERSINFO > 3)) && shopt -s autocd
export PAGER='less -R' export PAGER='less -R'
export EDITOR='vim' export EDITOR='vim'
@ -46,7 +47,7 @@ prompt_command()
prompt_user="${pred}\u${preset} " prompt_user="${pred}\u${preset} "
bang="${pred}>${preset}" bang="${pred}>${preset}"
fi fi
ps_line1="[ ${prompt_user}${HOSTNAME}:${pblack}$(pwd)${preset} ]" ps_line1="[ bash-$BASH_VERSINFO | ${prompt_user}${HOSTNAME}:${pblack}$(pwd)${preset} ]"
ps_line2="${bang} " ps_line2="${bang} "
PS1="${ps_line1}\n${ps_line2}" PS1="${ps_line1}\n${ps_line2}"
} }
@ -54,11 +55,11 @@ PROMPT_COMMAND=prompt_command
# }}} # }}}
# {{{ plugins and traps # {{{ plugins and traps
aliases="${HOME}/.aliases" aliases="${HOME}/.aliases"
plugins="${HOME}/.bashplugins"
localconf="${HOME}/.bashlocal" localconf="${HOME}/.bashlocal"
plugins="${HOME}/.bashplugins"
[[ -r "${aliases}" ]] && . "${aliases}" [[ -r "${aliases}" ]] && . "${aliases}"
[[ -r "${plugins}" ]] && . "${plugins}"
[[ -r "${localconf}" ]] && . "${localconf}" [[ -r "${localconf}" ]] && . "${localconf}"
[[ -r "${plugins}" && $BASH_VERSINFO -gt 3 ]] && . "${plugins}"
unset aliases plugins localconf unset aliases plugins localconf
# we want to see exit code on error (it also has to be the last entry here) # we want to see exit code on error (it also has to be the last entry here)