Change PS1 when :sh'ing in VIM
Hi
I've had my prompt change whenever I :sh (:shell) out of VIM, but can't for the life of me remember how.. Google'ing for a bit diden't help me much, this might :-). The idea is to change the prompt to something like [SH] <your usual prompt here>, so that I know that VIM is running in the background.. I often logout of the shell, because I think VIM is open. Any ideas how? Thanks! |
I used to do something similar in vim using a different shell (system used tcsh, vim used bash) although it's probably not what you're remembering.
Code:
set shell=/bin/bash Another way to do it would be have your startup files check for the value of $VIM when vim is running that variable is set, when it's not... it's not (unless you manually set it.) (in .bashrc or whatever startup file for your shell you like) Code:
if [ $VIM ]; then |
Quote:
You could also do: Code:
set shell=/bin/bash\ --rcfile\ /home/whatever/.vimbash Code:
export PS1='[SH] \u@\h \w> \a' Thanks for your help :-) |
No problem, glad you got a resolution!
|
All times are GMT -5. The time now is 03:30 PM. |