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

Re: Expanding variables

Expand Messages
  • Tim Chase
    ... -tim --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more information, visit
    Message 1 of 3 , Nov 8, 2009
    • 0 Attachment
      > If I have these lines in a script:
      >
      > let filename = something
      > new filename
      >
      > new takes the literal string 'filename' instead of expanding it and
      > using its value. How can I tell :new to expand the variable instead?

      You can use exec:

      :exec 'new '.filename

      -tim



      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.