Oh My Git! support

This commit is contained in:
Austen Adler 2014-11-16 11:42:22 -05:00
parent 7b42500485
commit ba683626a7
2 changed files with 6 additions and 0 deletions

View File

@ -172,6 +172,7 @@ building:
* `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH in * `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH in
* `LP_ENABLE_RUNTIME`, if you want to display the runtime of the last command * `LP_ENABLE_RUNTIME`, if you want to display the runtime of the last command
* `LP_ENABLE_TIME`, if you want to display the time at which the prompt was shown * `LP_ENABLE_TIME`, if you want to display the time at which the prompt was shown
* `LP_ENABLE_OHMYGIT`, if you want to enable [Oh My Git](https://github.com/arialdomartini/oh-my-git)
* `LP_TIME_ANALOG`, when showing time, use an analog clock instead of numeric values * `LP_TIME_ANALOG`, when showing time, use an analog clock instead of numeric values
Note that if required commands are not installed, enabling the Note that if required commands are not installed, enabling the

View File

@ -290,6 +290,7 @@ _lp_source_config()
LP_ENABLE_LOAD=${LP_ENABLE_LOAD:-1} LP_ENABLE_LOAD=${LP_ENABLE_LOAD:-1}
LP_ENABLE_BATT=${LP_ENABLE_BATT:-1} LP_ENABLE_BATT=${LP_ENABLE_BATT:-1}
LP_ENABLE_GIT=${LP_ENABLE_GIT:-1} LP_ENABLE_GIT=${LP_ENABLE_GIT:-1}
LP_ENABLE_OHMYGIT=${LP_ENABLE_OHMYGIT:-0}
LP_ENABLE_SVN=${LP_ENABLE_SVN:-1} LP_ENABLE_SVN=${LP_ENABLE_SVN:-1}
LP_ENABLE_VCSH=${LP_ENABLE_VCSH:-1} LP_ENABLE_VCSH=${LP_ENABLE_VCSH:-1}
LP_ENABLE_FOSSIL=${LP_ENABLE_FOSSIL:-1} LP_ENABLE_FOSSIL=${LP_ENABLE_FOSSIL:-1}
@ -1695,8 +1696,10 @@ _lp_set_prompt()
# Insert it in the prompt # Insert it in the prompt
PS1="${LP_TITLE}${PS1}" PS1="${LP_TITLE}${PS1}"
[[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1"
else else
PS1=$LP_PS1 PS1=$LP_PS1
[[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1"
fi fi
if [[ -z "$LP_RPS1" ]] ; then if [[ -z "$LP_RPS1" ]] ; then
RPS1="${LP_TIME}${LP_LOAD}${LP_TEMP}${LP_BATT}" RPS1="${LP_TIME}${LP_LOAD}${LP_TEMP}${LP_BATT}"
@ -1727,6 +1730,7 @@ _lp_set_prompt()
# Insert it in the prompt # Insert it in the prompt
PS1="${LP_TITLE}${PS1}" PS1="${LP_TITLE}${PS1}"
[[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1"
# Glue the bash prompt always go to the first column. # Glue the bash prompt always go to the first column.
# Avoid glitches after interrupting a command with Ctrl-C # Avoid glitches after interrupting a command with Ctrl-C
@ -1734,6 +1738,7 @@ _lp_set_prompt()
#PS1="\[\033[G\]${PS1}${NO_COL}" #PS1="\[\033[G\]${PS1}${NO_COL}"
else else
PS1=$LP_PS1 PS1=$LP_PS1
[[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1"
fi fi
fi fi
} }