Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
Then it reads different startup files than the original shell.
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)
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
Then it reads different startup files than the original shell.
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
export PS1='[VIM]\h:\w\$ '
fi
works for me.
Ah yes, very nice.
You could also do:
Code:
set shell=/bin/bash\ --rcfile\ /home/whatever/.vimbash
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.