Friday, October 1, 2010

Re: Question about environment variables in vimscript

Ответ на сообщение «Question about environment variables in vimscript»,
присланное в 21:53:36 01 октября 2010, Пятница.
Отправитель: H Xu:

You can modify enviroment variables from vimscript using
let $VARIABLE="value"
. You cannot export enviroment enviroment changes made by child process into
parent process neither in vimscript nor in other language: it is kernel level
restriction. If you see that something like
function SetVar() {
A="test"
}
A="test0"
echo $A
SetVar
echo $A
echoes `test0' and then `test' it only means that `SetVar' function is executed
inside the same shell process. Parsing text that script outputs to stdout is the
only way to modify vim enviroment.

Текст сообщения:
> Hello everybody,
>
> In vimscript, it is possible to modify the environment variables. My
> question
> is, how to execute a sh or batch file inside vimscript and the the
> changes of
> environment variables made by them take effect?
>
> Thanks.
>
> Regards,
> Hong Xu
> 2010/10/2

No comments: