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

vim: how to copy selected text from vim running inside a remote ssh session, to local windows clipboard

Expand Messages
  • ping song
    experts: not sure this was asked before... I run ssh into remote pc(linux) from local PC (windows), run vim from within ssh then select some text from vim now
    Message 1 of 6 , Jun 5, 2014
    • 0 Attachment
      experts:
      not sure this was asked before...
      I run ssh into remote pc(linux) from local PC (windows),
      run vim from within ssh
      then select some text from vim

      now I want to paste these text into local clipboard (so I can paste into outlook, etc).. is there any good way to implement this?
      I currently rely on dropbox to sync all change and open the file with notepad...but really want to know of any other better solutions..

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Ben Fritz
      ... You can run an X server on your Windows machine. For example: Xming, X-Win32, something in Cygwin, Xceed, and I m sure there are others. Then you just need
      Message 2 of 6 , Jun 6, 2014
      • 0 Attachment
        On Thursday, June 5, 2014 11:03:49 PM UTC-5, ping wrote:
        > experts:
        > not sure this was asked before...
        > I run ssh into remote pc(linux) from local PC (windows),
        > run vim from within ssh
        > then select some text from vim
        >
        >
        >
        > now I want to paste these text into local clipboard (so I can paste into outlook, etc).. is there any good way to implement this?
        > I currently rely on dropbox to sync all change and open the file with notepad...but really want to know of any other better solutions..

        You can run an X server on your Windows machine. For example: Xming, X-Win32, something in Cygwin, Xceed, and I'm sure there are others. Then you just need a Vim running on your server with X clipboard support (or run gvim).

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Charles E Campbell
        ... An alternate procedure would be to run vim locally and use netrw to work with the remote machine (vim scp://user@remotemachine/path/file). That way you
        Message 3 of 6 , Jun 6, 2014
        • 0 Attachment
          Ben Fritz wrote:
          > On Thursday, June 5, 2014 11:03:49 PM UTC-5, ping wrote:
          >> experts:
          >> not sure this was asked before...
          >> I run ssh into remote pc(linux) from local PC (windows),
          >> run vim from within ssh
          >> then select some text from vim
          >>
          >>
          >>
          >> now I want to paste these text into local clipboard (so I can paste into outlook, etc).. is there any good way to implement this?
          >> I currently rely on dropbox to sync all change and open the file with notepad...but really want to know of any other better solutions..
          > You can run an X server on your Windows machine. For example: Xming, X-Win32, something in Cygwin, Xceed, and I'm sure there are others. Then you just need a Vim running on your server with X clipboard support (or run gvim).
          >
          An alternate procedure would be to run vim locally and use netrw to work
          with the remote machine (vim scp://user@remotemachine/path/file). That
          way you could use the local clipboard.

          Regards,
          Chip Campbell

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • lessthanideal
          ... Do you have to use ssh the tool, and vim visual selection, as such? With an ssh client such as putty, you can simply select the text in the putty window
          Message 4 of 6 , Jun 6, 2014
          • 0 Attachment
            W dniu piątek, 6 czerwca 2014 05:03:49 UTC+1 użytkownik ping napisał:
            > experts:
            > not sure this was asked before...
            > I run ssh into remote pc(linux) from local PC (windows),
            > run vim from within ssh
            > then select some text from vim
            >
            >
            >
            > now I want to paste these text into local clipboard (so I can paste into outlook, etc).. is there any good way to implement this?
            > I currently rely on dropbox to sync all change and open the file with notepad...but really want to know of any other better solutions..

            Do you have to use ssh the tool, and vim visual selection, as such? With an ssh client such as putty, you can simply select the text in the putty window and it appears in the Windows clipboard.

            This doesn't work with selections done using vim commands (e.g. "V"), so may not be what you want. I guess putty is actually copying the text from its local buffer for its own Window into the clipboard.

            regards,
            Geoff

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • 'Chandra Amarasingham' via vim_us
            Not sure if I understand the problem correctly, but if are using something like putty for ssh, you should be able to highlight the text and paste into outlook,
            Message 5 of 6 , Jun 6, 2014
            • 0 Attachment
              Not sure if I understand the problem correctly, but if are using
              something like putty for ssh, you should be able to highlight the text
              and paste into outlook, etc..., simply highlighting should make it
              available on the clipboard.
              Chandra

              On 06/07/2014 12:29 AM, Ben Fritz wrote:
              > On Thursday, June 5, 2014 11:03:49 PM UTC-5, ping wrote:
              >> experts:
              >> not sure this was asked before...
              >> I run ssh into remote pc(linux) from local PC (windows),
              >> run vim from within ssh
              >> then select some text from vim
              >>
              >>
              >>
              >> now I want to paste these text into local clipboard (so I can paste into outlook, etc).. is there any good way to implement this?
              >> I currently rely on dropbox to sync all change and open the file with notepad...but really want to know of any other better solutions..
              > You can run an X server on your Windows machine. For example: Xming, X-Win32, something in Cygwin, Xceed, and I'm sure there are others. Then you just need a Vim running on your server with X clipboard support (or run gvim).
              >

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Tim Chase
              ... [please don t top-post] This works for small and contiguous blocks of text, but doesn t work well if either: 1) you want to copy large blocks of text that
              Message 6 of 6 , Jun 7, 2014
              • 0 Attachment
                On 2014-06-07 14:29, 'Chandra Amarasingham' via vim_use wrote:
                > Not sure if I understand the problem correctly, but if are using
                > something like putty for ssh, you should be able to highlight the
                > text and paste into outlook, etc..., simply highlighting should
                > make it available on the clipboard.

                [please don't top-post]

                This works for small and contiguous blocks of text, but doesn't work
                well if either:

                1) you want to copy large blocks of text that can't fit on the screen
                at the same time (or in the scroll-back buffer)

                2) you want to copy via various yank/ex commands such as

                :let @+=@%

                or where I commonly would do something like

                :let @a=''|g/pattern/y A
                :let @+=@a

                to gather up matching lines and put them in the clipboard.

                -tim




                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.