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

:put alternatives?

Expand Messages
  • Alex
    Is there any command like :put that will work on a variable instead of a register? ... but :put only works with registers, and I dont feel like using a
    Message 1 of 2 , Jul 2, 2001
    • 0 Attachment
      Is there any command like :put that will work on a variable instead of a
      register?
      I want to do something like:
      :let g:foo="Some String"
      :put g:foo

      but :put only works with registers, and I dont feel like using a register
      for this purpose.
      is there anything I can do to insert the text from a global variable into
      the text I'm editing?

      Thanks again guys!!
      Alex
    • Benji Fisher
      ... Briefly, any time you can use a register a, you can use ={expr}. HTH --Benji Fisher
      Message 2 of 2 , Jul 2, 2001
      • 0 Attachment
        Alex wrote:
        >
        > Is there any command like :put that will work on a variable instead of a
        > register?
        > I want to do something like:
        > :let g:foo="Some String"
        > :put g:foo
        >
        > but :put only works with registers, and I dont feel like using a register
        > for this purpose.
        > is there anything I can do to insert the text from a global variable into
        > the text I'm editing?

        Use the expression register:

        :put=g:foo

        :help :put
        :help "=

        Briefly, any time you can use a register "a, you can use "={expr}.

        HTH --Benji Fisher
      Your message has been successfully submitted and would be delivered to recipients shortly.