I wanted to set the VIMHOME variable this way (common to Windows and Linux),
let $VIMHOME=expand("%:p")."/..",
so that VIMHOME is "~/.vim" in Linux or "path/to/vimfiles" in Windows.
I put this in a var.vim file and placed this in the plugin directory.
It loads properly, but VIMHOME is set only to "./..".
How do I get the full path of a file using expand?
Is there an easy way to set VIMHOME?
Edit: I changed the expression to:
let $VIMHOME=expand("<sfile>:p:h")
Now, VIMHOME is set to "~/.vim/plugin" in Linux.
My requirement is setting VIMHOME to "~/.vim" or "path/to/vimfiles". But,
let $VIMHOME=expand("<sfile>:p:h")
let $VIMHOME=expand("$VIMHOME:p:h")
is not working.
How can I resolve this?
:h. I have updated my answer. – Chris Johnsen Mar 15 '10 at 9:30