Loading ...
Sorry, an error occurred while loading the content.

Re: Question about environment variables in vimscript

Expand Messages
  • ZyX
    Ответ на сообщение «Question about environment variables in vimscript», присланное в 21:53:36 01 октября 2010,
    Message 1 of 4 , Oct 1, 2010
    • 0 Attachment
      Ответ на сообщение «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
    • H Xu
      ... Hi ZyX: I have understood. Thank you very much. H Xu 2010/10/2 -- You received this message from the vim_use maillist. Do not top-post! Type your reply
      Message 2 of 4 , Oct 1, 2010
      • 0 Attachment
        On 2010/10/2 2:31, ZyX wrote:
        > Ответ на сообщение <<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

        Hi ZyX:

        I have understood. Thank you very much.

        H Xu
        2010/10/2

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.