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

sourcing the contents of a register

Expand Messages
  • Douglas L . Potts
    I can t remember if this has come across the list before... I want to re-source part of my vimrc, without having to write the section out to file, source that,
    Message 1 of 5 , Aug 1 4:51 AM
    • 0 Attachment
      I can't remember if this has come across the list before...

      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).

      Anyone done this?

      Thanks,
      -Doug

      --
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
      Douglas L. Potts
      "Many of the truths we cling to depend greatly upon our own point of
      view." -Obi Wan Kenobi
      GPG Fingerprint: 768A EEF8 197A 4C9A 5EF7 DA5B 464C 97DF DCD5 68C2
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    • Cory T. Echols
      ... Yank the relevant portions to a register (say a), and then do ... I just tried this for some simple cases and it seems to work, but I have this feeling
      Message 2 of 5 , Aug 1 5:05 AM
      • 0 Attachment
        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.

        :he :exe
        :he expr-register

        --
        Cory T. Echols
        ctechols@...
      • Jürgen Krämer
        Hi, ... does ... work, if the relevant section is in register r? I just tested it with two lines and it seems to work, but I am not sure whether each line has
        Message 3 of 5 , Aug 1 5:17 AM
        • 0 Attachment
          Hi,

          "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).

          does

          :@r

          work, if the relevant section is in register r? I just tested it with
          two lines and it seems to work, but I am not sure whether each line
          has to be prepended with a colon.

          Regards,
          Jürgen

          --
          Jürgen Krämer Softwareentwicklung/-support
          Habel GmbH mailto:jkraemer@...
          Hinteres Öschle 2 Tel: (0 74 61) 93 53 15
          78604 Rietheim-Weilheim Fax: (0 74 61) 93 53 99
        • Douglas L . Potts
          ... 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
          Message 4 of 5 , Aug 1 9:24 AM
          • 0 Attachment
            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.

            -Doug

            --
            *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
            Douglas L. Potts
            "In a world without fences, who needs Gates and Windows?"
            (from Bram Moolenaar's varied list of quotes, no attributed author)
            GPG Fingerprint: 768A EEF8 197A 4C9A 5EF7 DA5B 464C 97DF DCD5 68C2
            *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
          • 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 5 of 5 , Aug 1 6:22 PM
            • 0 Attachment
              "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.