Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Same problem here, and I can't change $HOME as it was set by my development environment to a read-only net drive :( –  Deqing Nov 17 at 23:16

2 Answers 2

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.

share|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 –  asattar Jul 10 '11 at 4:05
    
I changed the HOME environment variable and it worked. Thanks. –  asattar Jul 10 '11 at 4:09

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'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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