:help $MYVIMRC clearly states:
The $ MYVIMRC environment variable is set to the file that was first found, unless MYVIMRC was set and when using VIMINIT.
Thus, you can use this to open the existing Vim configuration, but not create it. If you look closely, you will see that
:e $MYVIMRC :w
will answer
"$MYVIMRC" [New File]
So, you created a file called $MYVIMRC in the current directory (since the variable was not set).
To create an empty .vimrc just use
:e $HOME/.vimrc
Since this is a one-time action, all this worries the right approach, in any case, not very useful.
Ingo karkat
source share