From 2b26946eda970d6071d56c9787622583826ccefd Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Thu, 7 May 2020 00:10:20 +0000 Subject: [PATCH] Update bash config --- .bashrc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.bashrc b/.bashrc index fb50ceb..eed6e28 100644 --- a/.bashrc +++ b/.bashrc @@ -4,13 +4,25 @@ # load aliases dynamically [ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" +# prompt +bold=$(tput bold) +reset=$(tput sgr0) -# PS1='\u@\h \W\$ ' -PS1='\W \u $ ' +get_branch_name() { + git symbolic-ref --quiet --short HEAD 2>/dev/null \ + || git rev-parse --short HEAD 2>/dev/null \ + || echo 'some branch' +} -# nvm -source /usr/share/nvm/init-nvm.sh +get_git_info() { + 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 export HISTCONTROL=ignoreboth +# source fuzzy finder +source /usr/share/fzf/*.bash