Update bash config

master
Hektor Misplon 2020-05-07 00:10:20 +00:00
parent 507653ddaf
commit 2b26946eda
1 changed files with 16 additions and 4 deletions

20
.bashrc
View File

@ -4,13 +4,25 @@
# load aliases dynamically # load aliases dynamically
[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" [ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc"
# prompt
bold=$(tput bold)
reset=$(tput sgr0)
# PS1='\u@\h \W\$ ' get_branch_name() {
PS1='\W \u $ ' git symbolic-ref --quiet --short HEAD 2>/dev/null \
|| git rev-parse --short HEAD 2>/dev/null \
|| echo 'some branch'
}
# nvm get_git_info() {
source /usr/share/nvm/init-nvm.sh git rev-parse --is-inside-work-tree &>/dev/null || return
echo -e "- ${1}$(get_branch_name)"
}
PS1='\[\033[38;5;244m\]\[${bold}\]$(get_git_info && echo "\n")\[${reset}\]\u \W $ '
# history # history
export HISTCONTROL=ignoreboth export HISTCONTROL=ignoreboth
# source fuzzy finder
source /usr/share/fzf/*.bash