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

put at end of line

Expand Messages
  • RICHARD PITMAN
    Hi folks, Is there a quick way to insert the contents of a buffer at the end of a line without having to move the cursor there explicitly (equivalent to
    Message 1 of 4 , May 25, 2005
    • 0 Attachment
      Hi folks,

      Is there a quick way to insert the contents of a
      buffer at the end of a line without having to move the
      cursor there explicitly (equivalent to "ma$p`a")

      TIA

      Rich
    • jamessan@jamessan.com
      ... There s no command (as far as I know) to paste somewhere other than the cursor, though. James -- GPG Key: 1024D/61326D40 2003-09-02 James Vega
      Message 2 of 4 , May 25, 2005
      • 0 Attachment
        On Wed, May 25, 2005 at 02:50:24PM +0100, RICHARD PITMAN wrote:
        > Is there a quick way to insert the contents of a
        > buffer at the end of a line without having to move the
        > cursor there explicitly (equivalent to "ma$p`a")

        You could setup a mapping to do that for you:

        :nmap <Leader>p ma$p`a

        :help :nmap
        :help <Leader>

        There's no command (as far as I know) to paste somewhere other than the
        cursor, though.

        James
        --
        GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@...>
      • Tim Chase
        ... Well, it may depend on what type of buffer (usually what you describe as a buffer is called a register ...buffers are more like files than copies of
        Message 3 of 4 , May 25, 2005
        • 0 Attachment
          > Is there a quick way to insert the contents of a buffer at the
          > end of a line without having to move the cursor there
          > explicitly (equivalent to "ma$p`a")

          Well, it may depend on what type of "buffer" (usually what you
          describe as a "buffer" is called a "register"...buffers are more
          like files than copies of select text). If it's characterwise,
          you may have to do your little stunt. Other things that might
          work would be

          :s/$/\=@"

          You might still have to save/restore your position. However, you
          can wrap this in the fairly common

          :let c=virtcol(".") | s/$/\=@"/ | exe "norm ".c."|"

          As usual, this can be mapped to a single keystroke. With a
          little chicanery, the key to which you map it may be able to take
          a register letter as a prefixed parameter. Dr. Chip or others on
          the list may have futher suggestions for doing such convolutions.

          -tim
        • RICHARD PITMAN
          ... Many thanks for the help folks - great as usual! :) Remapped P to ma$p`a for the duration of the session. Thanks again. Richard
          Message 4 of 4 , May 26, 2005
          • 0 Attachment
            > On Wed, May 25, 2005 at 02:50:24PM +0100, RICHARD
            > PITMAN wrote:
            > > Is there a quick way to insert the contents of a
            > > buffer at the end of a line without having to move
            > the
            > > cursor there explicitly (equivalent to "ma$p`a")
            >
            > You could setup a mapping to do that for you:
            >
            > :nmap <Leader>p ma$p`a
            >
            > :help :nmap
            > :help <Leader>
            >
            > There's no command (as far as I know) to paste
            > somewhere other than the
            > cursor, though.
            >
            > James
            > --

            Many thanks for the help folks - great as usual! :)

            Remapped P to ma$p`a for the duration of the session.

            Thanks again.

            Richard
          Your message has been successfully submitted and would be delivered to recipients shortly.