Search code examples
vimvi

How to copy text from vi to clipboard and vice versa on MacOS?


I know how to copy in VI. but I failed to copy it into other application. That means I failed copy those into clipboard. How can I do this?

P.S. In order to lean more. I also want to ask how to copy content from clipboard to vi.

Edited: I am using MacOs. running Vim.

It seems *yy doesn't work here. Any other ways?


Solution

  • You need to use the clipboard register, which is *, so to copy a line of text into clipboard:

    "*yy
    

    To paste a line of text from the clipboard:

     "*p