nojhan/liquidprompt — pull request #71 by jaesivsm (2012-09-11 12:02:17+00:00)
Title: refactoring _lp_shorten_path and use of PROMPT_DIRTRIM

I'm submitting this chunk of code for merge but there are several points that may be needed to be discussed :

I refactored _lp_shorten_path so the bash shell would use the PROMPT_DIRTRIM instead of cutting manually into the path it's going to display. The use of PROMPT_DIRTRIM doesn't allow to keep several directories at the beginning of the path (the LP_PATH_KEEP var). It can be considered as a regression.

Only bash version 4 implement PROMPT_DIRTRIM, so I had to keep another chunk of code (which I changed quite a bit) which cut manually through the path. It can be considered as duplicate code.

I changed the way config files are sourced in a way I find logical. After a quick search I didn't find any reason to do otherwise, but I'm quite sure I missed something. Feel free to point it out.

In the end I with minimal configuration "\w" is used along with PROMPT_DIRTRIM and I think it's a real improvement to use builtin parameters like this.