@tykling not at the computer at the moment, but I hae one that checks an env var that is set by vim so I can easily tell if I'm :sh'ing and don't start nested vim sessions :D
@Tak I use it all the time! The problem is I tend to lose track where my vim session is, and this PS1 helps. It's useful for compiling, poking around etc.
@tykling In .vimrc I put `let $VIM_IS_OPEN = '(vim is open)'` and then in the PS1 I just put $VIM_IS_OPEN somewhere.