diff --git a/.bash/git-aware-prompt b/.bash/git-aware-prompt new file mode 160000 index 0000000..ee81e21 --- /dev/null +++ b/.bash/git-aware-prompt @@ -0,0 +1 @@ +Subproject commit ee81e21a6d9c77e9a12cda61472d57921b3a3b2b diff --git a/.bashrc b/.bashrc index cfe35f7..6c9d54a 100644 --- a/.bashrc +++ b/.bashrc @@ -5,6 +5,9 @@ # bash history with time export HISTTIMEFORMAT="%F %T " +export GITAWAREPROMPT="$HOME/.bash/git-aware-prompt" +source "$GITAWAREPROMPT/main.sh" + ## ## prompt games ## @@ -42,7 +45,7 @@ PS1="$PS1"'$(if [ -L "$PWD" ]; then echo -ne "\[$On_Blue\]"; fi)' # DYNAMIC: wd length < 6 (/, /etc, /usr, /var, /home etc) brings red wd name PS1="$PS1"'$(if [ ${#PWD} -lt 6 ]; then echo -ne "\[$BRed\]"; else echo -ne "\[$BGreen\]"; fi)\W' -PS1="$PS1\[$Color_Off\]\[$BGreen\]]\\$\[$Color_Off\] " +PS1="$PS1\[$Color_Off\]\[$BGreen\]]"'$git_branch$git_dirty'"\\$\[$Color_Off\] " export EDITOR=vim export BROWSER=chromium @@ -258,7 +261,7 @@ function title() { fi } -trap 'title "$BASH_COMMAND"' DEBUG +trap 'title "$BASH_COMMAND" "$BASH_COMMAND"' DEBUG # TODO: delete this upload() { diff --git a/.gitmodules b/.gitmodules index 9c46dc2..50c59b0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,3 +46,6 @@ [submodule ".vim/bundle/auto-pairs"] path = .vim/bundle/auto-pairs url = https://github.com/jiangmiao/auto-pairs +[submodule ".bash/git-aware-prompt"] + path = .bash/git-aware-prompt + url = https://github.com/jimeh/git-aware-prompt.git