adding comments and documentation

This commit is contained in:
François Schmidts 2013-01-10 10:22:58 +01:00
parent 73a804d05d
commit 977fca59fb
2 changed files with 11 additions and 1 deletions

View File

@ -130,6 +130,13 @@ Note also that all the `LP_ENABLE_…` variables override the templates,
i.e. if you use `$LP_BATT` in your template and you set `LP_ENABLE_BATT=0` i.e. if you use `$LP_BATT` in your template and you set `LP_ENABLE_BATT=0`
in your config file, you will not have the battery informations. in your config file, you will not have the battery informations.
If you are using bash and want to use the `PROMPT_DIRTRIM` built-in
functionality to shorten but still have liquidprompt calculating the number of
directories to keep in the path, precise a value for `PROMPT_DIRTRIM` before
sourcing liquidprompt and liquidprompt will override this value with one
fitting the width of your terminal.
## CUSTOMIZING THE PROMPT ## CUSTOMIZING THE PROMPT
### ADD A PS1 PREFIX ### ADD A PS1 PREFIX

View File

@ -490,7 +490,10 @@ _lp_shorten_path()
fi fi
} }
# In bash shell, PROMPT_DIRTRIM is the number of directory to keep at the end
# of the displayed path (if "\w" is present in the PS1 var).
# liquidprompt can calculate this number under two condition, path shortening
# must be activated and PROMPT_DIRTRIM must be already set.
_lp_get_dirtrim() { _lp_get_dirtrim() {
[[ "$LP_ENABLE_SHORTEN_PATH" != 1 ]] && echo 0 && return [[ "$LP_ENABLE_SHORTEN_PATH" != 1 ]] && echo 0 && return