I have changed the registry settings so that the user's folder is not saved in C: but in E:. Everything is working fine except for Vim (and Cygwin, but I don't want it now).

Whenever I launch Vim, it automatically creates a new folder C:\Users\Administrator and starts saving its files there.

That's because $HOME is C:\Users\Administrator. I want it to change so that it can point to my custom location.

link|improve this question

80% accept rate
feedback

2 Answers

up vote 5 down vote accepted

I think Vim should set $HOME to ${HOMEDRIVE}${HOMEPATH} unless you already have %HOME% set to something else in the Windows environment.

If you start a Command Prompt, and run:

set | findstr /R "^HOME"

I think you should see

HOMEDRIVE=E:
HOMEPATH=\Users\Administrator

I suspect that either the HOMEDRIVE is still set to C: (your change of Users folder didn't take) or there's a setting there for HOME too.

link|improve this answer
use %USERPROFILE% as the variable ... – akira Jul 8 '11 at 10:59
%USERPROFILE% does not necessarily have the same value: domain users with a remote profile, for example. – njd Jul 8 '11 at 15:52
en.wikipedia.org/wiki/… .. "Its value is the location of the current user's profile directory" ... looks ok for me. – akira Jul 8 '11 at 18:43
This is my output if I run the command: HOME=C:\Users\Administrator HOMEDRIVE=E: HOMEPATH=\Users\Abdulsattar – CodingTales Jul 10 '11 at 4:05
I changed the HOME environment variable and it worked. Thanks. – CodingTales Jul 10 '11 at 4:09
show 1 more comment
feedback

You could set the environment variable VIMINIT to source E:/Users/Administrator/vimrc. Then in that vimrc file you'll need to set the 'runtimepath' option to an appropriate value to find all your plugins. See

:help VIMINIT
:help 'runtimepath'
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.