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

Re: Cutting and pasting between two different files

Expand Messages
  • Michael Hernandez
    ... There s no need to quit the file you re editing in order to open a new file. Just use :edit or something similar to open a new file in another buffer or
    Message 1 of 7 , Oct 18, 2012
    • 0 Attachment
      On Oct 18, 2012, at 2:18 PM, Dave <laredotornado@...> wrote:

      > Hi,
      >
      > I'm using vim 7.3 on Mac 10.7.5. How do I enable cutting and pasting between different vim sessions within the same shell? That is, I start one vim session, copy some text, quit the file I'm editing, open a new file, and then paste what I copied in the previous file. I have seen this on other versions of vim I've used (don't remember the version numbers), and so wanted to ask how this can be configured, if at all.
      >
      > Thanks, - Dave
      >
      > --
      >
      There's no need to quit the file you're editing in order to open a new file. Just use :edit or something similar to open a new file in another buffer or tab and paste at will.

      --Mike H

      --
      You received this message from the "vim_mac" 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
    • Tony Mechelynck
      ... As Michael said, you don t need to quit the first file. You can open the second file in a split-window or in a new tabpage in the same Vim. If the file
      Message 2 of 7 , Oct 18, 2012
      • 0 Attachment
        On Oct 18, 8:18 pm, Dave <laredotorn...@...> wrote:
        > Hi,
        >
        > I'm using vim 7.3 on Mac 10.7.5.  How do I enable cutting and pasting between different vim sessions within the same shell?  That is, I start one vim session, copy some text, quit the file I'm editing, open a new file, and then paste what I copied in the previous file.  I have seen this on other versions of vim I've used (don't remember the version numbers), and so wanted to ask how this can be configured, if at all.
        >
        > Thanks, - Dave

        As Michael said, you don't need to quit the first file. You can open
        the second file in a split-window or in a new tabpage in the same Vim.

        If the file where you want to paste is already open in a different
        Vim, you should be able to paste via the clipboard (provided of course
        that both Vim instances were compiled with +clipboard and have access
        to the clipboard). This works on Windows and on Linux, I haven't tried
        it on a Mac.

        Best regards,
        Tony.
        --
        Manual, n.:
        A unit of documentation. There are always three or more on a
        given item. One is on the shelf; someone has the others. The
        information you need in in the others.
        -- Ray Simard

        --
        You received this message from the "vim_mac" 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
      • David Sanson
        By default, yanking doesn t yank to the system clipboard, and so the yanked text isn t available across different instances of vim. You can use *y to yank
        Message 3 of 7 , Oct 18, 2012
        • 0 Attachment
          By default, yanking doesn't yank to the system clipboard, and so the yanked text isn't available across different instances of vim. You can use "*y to yank text to the system clipboard and "*p to put text from the system clipbooard. Or you can put `set clipboard=unnamed` in your .vimrc, to use the system clipboard as the default register.

          (I'm no expert, so someone please correct this if it is wrong or misleading.)

          --
          You received this message from the "vim_mac" 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
        • Dave
          ... Hi, I created a file ~/.vimrc with set clipboard=unnamed but sadly no dice, yanking and pasting between two files. Thanks for the suggestion though, -
          Message 4 of 7 , Oct 18, 2012
          • 0 Attachment
            On Thursday, October 18, 2012 9:17:00 PM UTC-5, David Sanson wrote:
            > By default, yanking doesn't yank to the system clipboard, and so the yanked text isn't available across different instances of vim. You can use "*y to yank text to the system clipboard and "*p to put text from the system clipbooard. Or you can put `set clipboard=unnamed` in your .vimrc, to use the system clipboard as the default register.
            >
            > (I'm no expert, so someone please correct this if it is wrong or misleading.)

            Hi, I created a file ~/.vimrc with

            set clipboard=unnamed

            but sadly no dice, yanking and pasting between two files. Thanks for the suggestion though, - Dave

            --
            You received this message from the "vim_mac" 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
          • Tony Mechelynck
            ... On Windows, the * (star) and + (plus) registers both mean the system clipboard. On X11 systems, the + (plus) register is used by most programs (including
            Message 5 of 7 , Oct 19, 2012
            • 0 Attachment
              On Oct 19, 4:17 am, David Sanson <dsan...@...> wrote:
              > By default, yanking doesn't yank to the system clipboard, and so the yanked text isn't available across different instances of vim. You can use "*y to yank text to the system clipboard and "*p to put text from the system clipbooard. Or you can put `set clipboard=unnamed` in your .vimrc, to use the system clipboard as the default register.
              >
              > (I'm no expert, so someone please correct this if it is wrong or misleading.)

              On Windows, the * (star) and + (plus) registers both mean the system
              clipboard.

              On X11 systems, the + (plus) register is used by most programs
              (including gvim) for Edit→Copy, Edit→Cut and Edit→Paste, while the *
              (star) register is filled in most programs by selecting (highlighting)
              something on the screen, and pasted by clicking the middle mouse
              button.

              I'm not sure what happens in MacVim but you might try, at first, to
              start Visual mode (selecting whatever you want to copy) then use
              Edit→Copy in one instance and Edit→Paste in the other. If it works,
              look on the right side of the Edit menu which commands are triggered
              by these menuitems. Here on Linux, Edit→Copy means "+y and Edit→Paste
              means "+gP (the difference between P and gP is that gP leaves the
              cursor after the pasted text).

              --
              You received this message from the "vim_mac" 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
            • David Sanson
              Are you using the system vim on 10.7, or macvim? The system vim might not be compiled with clipboard support. Try vim --version And look for a +clipboard in
              Message 6 of 7 , Oct 19, 2012
              • 0 Attachment
                Are you using the system vim on 10.7, or macvim? The system vim might not be compiled with clipboard support. Try

                vim --version

                And look for a +clipboard in the features list.

                --
                You received this message from the "vim_mac" 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
              Your message has been successfully submitted and would be delivered to recipients shortly.