5

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.

1
  • 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 '14 at 23:16
7

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.

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

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'
0

If you do not want to change $HOME, try creating two new system environment variables:

$VIM: the directory you want to put vimrc and use as vimfiles

$VIMRUNTIME: the directory you install Vim (for example: E:\Program_Files\Vim\vim82)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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