Re: :shell and .bash_login
See this post: http://phaseportrait.blogspot.com/2007/12/file-associations-and-path-with-macvim.html which summarizes the common ways to fix this problem on OS X. Especially because the most recent MacVim snapshot has updated its file association database significantly, the best choice is just to use MacVim. As discussed elsewhere in this thread, starting vim (or gvim) from the Terminal should always land you in the right PATH. If you're starting gvim or mvim from a launcher, using gvim.app or mvim.app (or just MacVim in general) is the best way to go. If you're starting Terminal vim from a launcher, you should wrap it in a login shell bash -lc vim That's effectively how MacVim solves the problem with its instances of vim. --Ted On 12/31/08 5:32 AM, Hunt Jon wrote: > > Hi > > I'm using a Mac and VIM, which comes by default. If I run ":shell", > the shell doesn't seem to read any shell startup files such as > .bash_login, .profile or .bash_profile. > > The prompt just says: "bash-3.2$", which is different from what I get > when I open a Terminal window. > > Is there any way to VIM to read my startup files? > > John > > > > -- Ted Pavlic --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: :shell and .bash_login
On Dec 31 2008, 7:41 pm, Gary Johnson wrote: > On 2008-12-31, Hunt Jon wrote: [...] > If you want bash to do more than it does now when run from > Vim, put those extra shell commands and settings in your > ~/.bashrc file. I wouldn't think you'd need to make all the > settings in your ~/.profile every time you launch a new shell, > since that file should have been sourced when you first logged > in to your computer and those settings should already be in > the environment from which Vim was launched, but I'm not > familiar with Macs and how their OS might differ from > "standard" Unix. I've had problems with this under Solaris and Linux. As long as vim or gvim are launched from the command line of an active shell (e.g. from an xterm), no problem, but when you start configuring menu entries and click-on icons, it's not always clear what the environment is when starting the program. What I often end up doing is writing a small shell script to start the program, after having set whatever needs to be set (generally by sourcing .bashrc---this isn't an interactive shell), and configuring the menu entry or button to invoke this script. -- James Kanze (GABI Software) email:james.ka...@gmail.com Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung 9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34 --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: :shell and .bash_login
On 2008-12-31, Ted Pavlic wrote: > Pardon the terse response. I'm on a cell phone. Look at shcf setting > in vim. Change to -lc to run a login shell. 'shcf' doesn't apply here. The OP is not executing a "!" or ":!" command--he's executing ":shell", which doesn't use 'shcf'. Regards, Gary --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: :shell and .bash_login
Pardon the terse response. I'm on a cell phone. Look at shcf setting in vim. Change to -lc to run a login shell. Otherwise use macvim with login shell pref checked on. Or adjust your environment.plist file. On 12/31/08, Gary Johnson wrote: > > On 2008-12-31, Hunt Jon wrote: >> Hi >> >> I'm using a Mac and VIM, which comes by default. If I run ":shell", >> the shell doesn't seem to read any shell startup files such as >> .bash_login, .profile or .bash_profile. >> >> The prompt just says: "bash-3.2$", which is different from what I get >> when I open a Terminal window. >> >> Is there any way to VIM to read my startup files? > > When you execute ":shell", Vim should run the program specified by > the value of the 'shell' option, which Vim determines automatically > upon startup. Vim runs this program without any arguments. When > started that way, bash should run in interactive mode, in which case > it should read the ~/.bashrc file. Bash won't read any "login" > files such as .bash_login, .profile or .bash_profile because it is > not being run as a login shell. > > See the INVOCATION section of the bash man page. > > If you want bash to do more than it does now when run from Vim, put > those extra shell commands and settings in your ~/.bashrc file. I > wouldn't think you'd need to make all the settings in your > ~/.profile every time you launch a new shell, since that file should > have been sourced when you first logged in to your computer and > those settings should already be in the environment from which Vim > was launched, but I'm not familiar with Macs and how their OS might > differ from "standard" Unix. > > Regards, > Gary > > > > > > --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
Re: :shell and .bash_login
On 2008-12-31, Hunt Jon wrote: > Hi > > I'm using a Mac and VIM, which comes by default. If I run ":shell", > the shell doesn't seem to read any shell startup files such as > .bash_login, .profile or .bash_profile. > > The prompt just says: "bash-3.2$", which is different from what I get > when I open a Terminal window. > > Is there any way to VIM to read my startup files? When you execute ":shell", Vim should run the program specified by the value of the 'shell' option, which Vim determines automatically upon startup. Vim runs this program without any arguments. When started that way, bash should run in interactive mode, in which case it should read the ~/.bashrc file. Bash won't read any "login" files such as .bash_login, .profile or .bash_profile because it is not being run as a login shell. See the INVOCATION section of the bash man page. If you want bash to do more than it does now when run from Vim, put those extra shell commands and settings in your ~/.bashrc file. I wouldn't think you'd need to make all the settings in your ~/.profile every time you launch a new shell, since that file should have been sourced when you first logged in to your computer and those settings should already be in the environment from which Vim was launched, but I'm not familiar with Macs and how their OS might differ from "standard" Unix. Regards, Gary --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---
:shell and .bash_login
Hi I'm using a Mac and VIM, which comes by default. If I run ":shell", the shell doesn't seem to read any shell startup files such as .bash_login, .profile or .bash_profile. The prompt just says: "bash-3.2$", which is different from what I get when I open a Terminal window. Is there any way to VIM to read my startup files? John --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---