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

how to paste from clipboard?

Expand Messages
  • Jorge Almeida
    I want to make a function that would: 1) :set paste 2) paste clipboard contents 3) :set nopaste Step 2 is what we get when the mouse middle bottom is pressed
    Message 1 of 6 , Apr 29, 2004
      I want to make a function that would:
      1) :set paste
      2) paste clipboard contents
      3) :set nopaste
      Step 2 is what we get when the mouse middle bottom is pressed on a
      window. I need step 1 to avoid indentation problems. The function would
      be invoked by a map in insert mode (the <Insert> key seems a nice
      choice). The problem is, what command can implement step 2?

      TIA,
      Jorge Almeida
    • jeanphilippe.gois@b-rail.be
      The clipboard content is held in the * register. So, in normal mode, you can just hit *p to insert the clipboard content. To do the same with a command you
      Message 2 of 6 , Apr 29, 2004
        The clipboard content is held in the * register. So, in normal mode,
        you can just hit "*p to insert the clipboard content.
        To do the same with a command you just type
        :put *

        cfr :
        :he :put
        :he clipboard


        HTH
        Flupke


        Jorge Almeida (29/04/04 08:56):
        >I want to make a function that would:
        > 1) :set paste
        > 2) paste clipboard contents
        > 3) :set nopaste
        >Step 2 is what we get when the mouse middle bottom is pressed on a
        >window. I need step 1 to avoid indentation problems. The function would
        >be invoked by a map in insert mode (the <Insert> key seems a nice
        >choice). The problem is, what command can implement step 2?
        >
        >TIA,
        >Jorge Almeida

        --
        << There's no place like ~! >>
      • gumnos (Tim Chase)
        ... pastes ... In addition to Antony s suggestion (good catch, Antony!) of using :put * , perhaps + is what you re looking for? There s further detail on
        Message 3 of 6 , Apr 29, 2004
          > "*p now does what it is supposed to. However, :put "* doesn't. It
          pastes
          > the contents of "". Maybe I should restart the X server?

          In addition to Antony's suggestion (good catch, Antony!) of using ":put
          *", perhaps "+ is what you're looking for? There's further detail on
          the peculiarities of X clipboards at

          :help x11-selection
          :help 'clipboard'

          which may give you more info that could be helpful in diagnosing these
          and future issues.

          -tim
        • David Rock
          ... I am using gentoo also, with gnome and I have found that -MiddleMouse pastes from the clipboard. I am using this while running vim in a terminal
          Message 4 of 6 , Apr 29, 2004
            * jeanphilippe.gois@... <jeanphilippe.gois@...> [2004-04-29 10:04]:
            > The clipboard content is held in the * register. So, in normal mode,
            > you can just hit "*p to insert the clipboard content.
            > To do the same with a command you just type
            > :put *
            >
            > cfr :
            > :he :put
            > :he clipboard

            I am using gentoo also, with gnome and I have found that
            <Shift>-MiddleMouse pastes from the clipboard. I am using this while
            running vim in a terminal window over an ssh tunnel, which seems to
            matter somehow.

            --
            David Rock
            david@...
          • Jorge Almeida
            ... It works for me also, even without shift. But the problem (solved) was to do it without touching the mouse, in order to use it in a command. Thanks anyway.
            Message 5 of 6 , Apr 29, 2004
              On Thu, 29 Apr 2004, David Rock wrote:

              > I am using gentoo also, with gnome and I have found that
              > <Shift>-MiddleMouse pastes from the clipboard. I am using this while
              > running vim in a terminal window over an ssh tunnel, which seems to
              > matter somehow.
              >
              It works for me also, even without shift. But the problem (solved) was
              to do it without touching the mouse, in order to use it in a command.
              Thanks anyway.

              Jorge Almeida
            • Jorge Almeida
              ... Thank you, I ll keep it in mind. Jorge
              Message 6 of 6 , May 1, 2004
                On Thu, 29 Apr 2004, gumnos (Tim Chase) wrote:
                > In addition to Antony's suggestion (good catch, Antony!) of using ":put
                > *", perhaps "+ is what you're looking for? There's further detail on
                > the peculiarities of X clipboards at
                >
                > :help x11-selection
                > :help 'clipboard'
                >
                > which may give you more info that could be helpful in diagnosing these
                > and future issues.
                Thank you, I'll keep it in mind.

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