An easier way to do this than overriding the
'runtimepath' setting in your vimrc is to set the
HOME environment variable for the vim command in your shell command. e.g.
Or in the Windows Command prompt:
(Note that Windows Vim uses the
HOME environment variable if it is set, but it usually isn't — and other programs won't generally check it — so it should be safe to set it persistently as we do above.)
You can then set up any Vim configuration you desire within that home directory, in the usual way. e.g.:
Windows Command Prompt:
N.B. As @eckes notes in a comment, this solution does have the caveat that
$HOME will point to the new directory rather than your real home directory, so the
$HOME environment variable and
~ shortcut can't be used for accessing files located there within an instance Vim running in this way. (Although you can of course still access such files using absolute paths or Windows's standard environment variables.) If you don't want this degree of separation from your usual environment, their solution might therefore be preferable.