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

Re: sourcing the contents of a register

Expand Messages
  • Benji Fisher
    ... I tried yanking a function definition. With ... it did not work. I think the :function command is special. Jürgen s suggestion, ... worked fine. HTH
    Message 1 of 5 , Aug 1, 2002
      "Douglas L . Potts" wrote:
      >
      > On Thu, Aug 01, 2002 at 08:05:22AM -0400 Cory T. Echols wrote:
      > > On 08/01, Douglas L . Potts wrote:
      > > > I want to re-source part of my vimrc, without having to write the
      > > > section out to file, source that, and then delete it. I would love to
      > > > be able to copy the section into a register, and then do some vim magic
      > > > to source the contents of the register (all without writing to the file
      > > > system).
      > >
      > > Yank the relevant portions to a register (say "a), and then do
      > > :exe @a. (The @a expands to the contents of the register).
      > >
      > > I just tried this for some simple cases and it seems to work, but I have
      > > this feeling there may be caveats that I'm unaware of.
      > I haven't run into any exceptions yet either. This fits what I was
      > looking for a little better than Jurgen's suggestion. I think this was
      > any expansions that are listed are handled correctly.
      >
      > I let you know if I find something that breaks this method, though I
      > don't expect to.
      >
      > Thanks to you both, Cory and Jürgen.

      I tried yanking a function definition. With

      :execute @"

      it did not work. I think the :function command is special. Jürgen's
      suggestion,

      :@"

      worked fine.

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