| 12345678910111213141516171819202122232425262728293031323334353637 |
- source ~/dotfiles/shell/env
- # Only load interactive settings when in interactive shells.
- [[ $- != *i* ]] && return
- source ~/dotfiles/shell/common/load
- for file in ~/dotfiles/shell/bash/*.bash; do
- source $file
- done
- [[ -r ~/.bashlocal ]] && source ~/.bashlocal
- # Command Prompt
- #
- # [host] directory gitinfo jobinfo
- # user -
- #
- PROMPT_COMMAND='PS1="
- ${FG[6]}[\h] ${FG[3]}$(shortcwd)$(__gitp " %s")$(getajob)
- ${FG[5]}\u - $cReset"'
- # Display suspended/backgrounded job count, if any.
- function getajob() {
- local jobcount=$(jobs | wc -l)
- [[ $jobcount -ne 0 ]] && printf " ${FG[63]}[jobs]: ${FG[1]}\j" || printf ''
- }
- # Display up to 3 segments of the current working directory.
- function shortcwd() {
- local folder=$(pwd) fld='[^/]*'
- folder=${folder/$HOME/"~"}
- folder=$(echo $folder | sed 's|.*/\('$fld'/'$fld'/'$fld'\)|\1|')
- printf "$folder"
- }
- [ -f ~/.fzf.bash ] && source ~/.fzf.bash
|