Re: How to override $HOME on Windows NT/XP?
Just to be clear, my User Profiles directory is in the usual spot on the C: drive. It's just the HOMEDRIVE, HOMEDIR, and HOMESHARE environment variables that are pointing to the network. Paul Stone On 11/21/06, Paul Stone <[EMAIL PROTECTED]> wrote: I know this is a bizarre request. I would like to prevent Vim from going to my Home directory. The reason is that my IT department has mapped my home directory to a laggy network drive with a login script. I can't override the Windows environment variables which set up the home directory, because the login script overrides my settings. I can set up the environment in a DOS box, but I like to be able to invoke Vim by using the "edit with vim" context menu item. Any advice on how to workaround this issue? Vim keeps grinding to a halt while waiting for a response from the network drive, so I have to solve this. If there's no way to workaround it in Vim, then I will contact IT to see if they can change my login script. Best Regards, Paul Stone
Re: How to override $HOME on Windows NT/XP?
Paul Stone wrote: I know this is a bizarre request. I would like to prevent Vim from going to my Home directory. The reason is that my IT department has mapped my home directory to a laggy network drive with a login script. I can't override the Windows environment variables which set up the home directory, because the login script overrides my settings. I can set up the environment in a DOS box, but I like to be able to invoke Vim by using the "edit with vim" context menu item. Any advice on how to workaround this issue? Vim keeps grinding to a halt while waiting for a response from the network drive, so I have to solve this. If there's no way to workaround it in Vim, then I will contact IT to see if they can change my login script. Best Regards, Paul Stone The system-wide vimrc $VIM/vimrc (with no period or underscore) is read before every other configuration file, even your own _vimrc. However, it is common to all users. If you have write (or file-creation) access to it, you could add to it something like if $HOME == 'Q:\home\paul' let $HOME = 'C:\paul\home' endif to establish a different $HOME directory, only for (g)vim and only for you. Best regards, Tony.
Re: How to override $HOME on Windows NT/XP?
Paul Stone wrote: Just to be clear, my User Profiles directory is in the usual spot on the C: drive. It's just the HOMEDRIVE, HOMEDIR, and HOMESHARE environment variables that are pointing to the network. Paul Stone Then it's even easier than what I suggested: if everyone can accept to use their %USERPROFILE% directory as the "Vim Home" directory, then you can write let $HOME = $USERPROFILE in the global $VIM/vimrc Best regards, Tony.
Re: How to override $HOME on Windows NT/XP?
Both methods worked like a charm. Thanks very much!! :) Setting it to USERPROFILE is a little more elegant, so I will go with that. I'm back to happy Vimming! Paul Stone On 11/21/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: Paul Stone wrote: > Just to be clear, my User Profiles directory is in the usual spot on > the C: drive. It's just the HOMEDRIVE, HOMEDIR, and HOMESHARE > environment variables that are pointing to the network. > > Paul Stone > Then it's even easier than what I suggested: if everyone can accept to use their %USERPROFILE% directory as the "Vim Home" directory, then you can write let $HOME = $USERPROFILE in the global $VIM/vimrc Best regards, Tony.
Re: How to override $HOME on Windows NT/XP?
On Tue 21-Nov-06 9:12pm -0600, Paul Stone wrote: > I know this is a bizarre request. I would like to prevent Vim from > going to my Home directory. The reason is that my IT department has > mapped my home directory to a laggy network drive with a login script. > I can't override the Windows environment variables which set up the > home directory, because the login script overrides my settings. > > I can set up the environment in a DOS box, but I like to be able to > invoke Vim by using the "edit with vim" context menu item. > > Any advice on how to workaround this issue? Vim keeps grinding to a > halt while waiting for a response from the network drive, so I have to > solve this. > > If there's no way to workaround it in Vim, then I will contact IT to > see if they can change my login script. Even if you can change almost nothing, you could could start Gvim/Vim with: Vim --cmd "let $HOME = 'where-ever-you-like'" The --cmd precedes EX and VIMRC files. -- Best regards, Bill
Re: How to override $HOME on Windows NT/XP?
Paul Stone wrote: Both methods worked like a charm. Thanks very much!! :) Setting it to USERPROFILE is a little more elegant, so I will go with that. I'm back to happy Vimming! Paul Stone What is "more" or "less" elegant than something else is a question of opinion. Beware though, that the method below changes $HOME within Vim for all users (all login names) on your system. Best regards, Tony. On 11/21/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: Paul Stone wrote: > Just to be clear, my User Profiles directory is in the usual spot on > the C: drive. It's just the HOMEDRIVE, HOMEDIR, and HOMESHARE > environment variables that are pointing to the network. > > Paul Stone > Then it's even easier than what I suggested: if everyone can accept to use their %USERPROFILE% directory as the "Vim Home" directory, then you can write let $HOME = $USERPROFILE in the global $VIM/vimrc Best regards, Tony.
Re: How to override $HOME on Windows NT/XP?
I can set up the environment in a DOS box, but I like to be able to invoke Vim by using the "edit with vim" context menu item. Well, if you're comfortable digging around in the registry, you might be able to find the "edit with vim" key...you might try HKCR\applications\gvim.exe\shell\edit\command HKLM\SOFTWARE\Classes\Applications\gvim.exe\shell\edit\command and change it so that it's something like ...\gvim.exe -u c:\path\to\local\vimrc "%1" I don't know which bits use those two registry keys (namely, if the "Edit With Vim" menu option executes the contents of either of these two keys), but it's worth a stab... HTH, -tim
Re: How to override $HOME on Windows NT/XP?
Hi, to me it's no clear what you mean by "prevent Vim from going to my Home directory". I'm using Vim on windows, too, but he never asked me for a HOME directory. Instead, the _vimrc file is kept in $VIMRUNTIME, which by default on XP is C:\Programme\Vim\vim70. Therefore, all you have to do is to put your _vimrc there and all should work fine. Cheers Wolfgang Paul Stone wrote: I know this is a bizarre request. I would like to prevent Vim from going to my Home directory. The reason is that my IT department has mapped my home directory to a laggy network drive with a login script. I can't override the Windows environment variables which set up the home directory, because the login script overrides my settings. I can set up the environment in a DOS box, but I like to be able to invoke Vim by using the "edit with vim" context menu item. Any advice on how to workaround this issue? Vim keeps grinding to a halt while waiting for a response from the network drive, so I have to solve this. If there's no way to workaround it in Vim, then I will contact IT to see if they can change my login script. Best Regards, Paul Stone
Re: How to override $HOME on Windows NT/XP?
Wolfgang Schmidt wrote: Hi, to me it's no clear what you mean by "prevent Vim from going to my Home directory". I'm using Vim on windows, too, but he never asked me for a HOME directory. Instead, the _vimrc file is kept in $VIMRUNTIME, which by default on XP is C:\Programme\Vim\vim70. Therefore, all you have to do is to put your _vimrc there and all should work fine. Cheers Wolfgang No it won't. 1. If $HOME exists, Vim will look first for $HOME/_vimrc and $HOME/.vimrc ; and if neither is found, it will look for $VIM/_vimrc and $VIM/.vimrc . $VIM is normally set (on Windows) to C:\Program Files\Vim so if you put your _vimrc in $VIMRUNTIME (aka $VIM/vim70), not only it won't be found, but the $HOME directory (which, on the OP's system, is on a slow remote disk) will be accessed twice. It is these accesses to the remote disk that the OP wants to avoid -- one way to do that is to set $HOME to something on C:\ -- for instance $USERPROFILE which is a user-private directory -- _before_ the user vimrc is looked for, i.e., either by means of a -cmd argument on the command-line, or by a command in a "system vimrc" named $VIM/vimrc (with no dot or underscore). 2. On a multiuser system like the OP's seems to be, $VIM and $VIMRUNTIME are common to all users, so putting the _vimrc there will force all users to use the same vimrc, something usually not desired. 3. Anything in $VIMRUNTIME or under it can be silently replaced by any upgrade; and the whole tree will be rebuilt under a different name by a version upgrade (e.g. $VIM/vim71 for Vim 7.1). For that reason, users should avoid placing anything there, other than files distributed together with Vim. Best regards, Tony.
RE: How to override $HOME on Windows NT/XP?
>I know this is a bizarre request. I would like to prevent Vim from >going to my Home directory. The reason is that my IT department has >mapped my home directory to a laggy network drive with a login script. >I can't override the Windows environment variables which set up the >home directory, because the login script overrides my settings. >I can set up the environment in a DOS box, but I like to be able to >invoke Vim by using the "edit with vim" context menu item. I got the same damned thing here at work, where everything's locked up tight and I can't touch it. "Policy", and all that... :P My own workaround for 'vim' and other critters is to just grab the usual desktop shortcuts, set the properties to what I prefer, and dump 'em into the "Send to" directory. Will be one level down from the "Edit with Vim" thingy, but at least it's a workaround. Same thing for using Firefox 1.5/2.0, Opera, Netscape 4.8, 6.x, and up, etc., instead of Exploder, so that I can pick which version for testing webpages in different browsers, and so on. If you can't override the defaults, dump 'em there and edit the prefs to your heart's content.