In some of my projects, I keep a var or a lib folder for runtime output and
external libraries. To keep my prompt rather short, I have the export
PROMPT_DIRTRIM=3 option in my .bashrc.
This works very well for most paths, but as soon as I have a /var in there, it goes nuts like this (for ~/Projects/someproject/var/gfx):
~/.../gfxr/gfxr/gfxr/gfxr/gfxr/gfx
Interestingly, it works with /opt/lampp/lib
Is there some way to get around this?

~/.../foo/var/foo. If you have edited your ~/.bashrc, please add its content to the question (you can use paste.ubuntu.com). – htorque Jun 20 '11 at 18:28