I just discovered that I am able to use ${ENVVAR}more_text
in a vim installation on Unix, but not if installed on Windows.
In Unix, I did in a shell:
export ABC=/tmp/
echo foo>${ABC}foo
gvim
Then, in the newly opened gvim Window, I tried
:e ${ABC}foo
which opened /tmp/foo
, as expected.
In Windows, however, I did (cmd.exe
):
set ABC=c:\temp\
echo foo > %ABC%foo
gvim
then, in gvim
:e ${ABC}foo
which opened a (non existing) file literally named ${ABC}foo
(which is not what I expected).
Is there a way to have vim expand the expression ${ABC}
on Windows as well, or an equipotent alternative?
I realize, that for this simple example, I could define the environment variable without trailing slash and add the slash in the :e
command while not using the braces at all. Yet, I want to achieve something more complex than that so that I fell I sort of need the ${ABC}
construct.
Edit
As per murus comment: in Windows, after starting gvim, if I do echo $ABC
, gvim prints c:\temp\
.
echo $ABC
in Windows Vim, do you get any output?:h $HOME
,${…}
is only for Unix. What if you doexe 'e' $ABC . "foo"
?