Wednesday, April 28, 2010

Re: $HOME variable not set properly in XP - showing "test"

Thanks Jürgen.

1. The :vimgrep didn't return any results.
2. Outside vim, %HOME% is not set
3. Before loading the .vimrc, the %HOME% is refering to 'test'

But your help, gave me hint. I added this line in the end of .vimrc and it worked
let $HOME = $HOMEDRIVE.$HOMEPATH

Thanks,
Krishna


On Wed, Apr 28, 2010 at 9:51 PM, Jürgen Krämer <jkr@jottkaerr.de> wrote:

Hi,

kp wrote:
>
> I am having problem in my XP machine.
> While closing GVIM window, I get an error "Can't write viminfo file
> test\_viminfo"
> This is irritating as I needs to press Enter at every time.
>
> When I debugged further it says $HOME is set to "test"!!!!!!!!!!!!
>
> Not sure why this is like this?
>
> The other variables look fine.
> $VIMRUNTIME = C:\Program Files\Vim\Vim72
> $HOMEDRIVE = C:
> $HOMEPATH = \Documents and Settings\kp
>
> Can you please let me know the solution?

is $HOME set to "test" outside of Vim, too? You can check this with

 echo %HOME%

in a "stand-alone" command line window. (Don't do this from a command
line window started with

 :sh

from inside Vim. This would inherit the incorrect value from Vim.)
Normally Windows does not define %HOME%, just %HOMEDRIVE% and
%HOMEPATH%, and Vim uses these two variable to initialize its own $HOME
variable whenever %HOME% is not set.

If it is not set outside of Vim it must have been changed from .vimrc or
a plugin file. You can either check every Vim script that gets
mentioned in the output of

 :scriptnames

manually or try something like (all on one line)

 :vimgrep /\clet $HOME.*=.*test/ $VIMRUNTIME/**/*.vim
$VIM/vimfiles/**/*.vim

Another cause might be a batch file that you use to start Vim and which
sets the value of %HOME%.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: