Paste text into vi file?

Hello,
I'm running OS X 10.7.4.
How can I paste text from the pasteboard into an open vim file?

Thanks!

Make sure vim is in insert mode, then use the paste option in the terminal?

Vim is in insert mode. Where is there a paste option? X11 is XQuartz 2.6.4.

Oh, you're running a graphical version of vim in X11? Try middle-clicking.

No, there is no GUI. And how would one middle click on a Mac?

You're not using X11 at all, then. OSX's usual graphical system has nothing to do with X11.

If you needed to middle-click, I think OSX has ways to emulate that, but if you're not using X11 that's neither here nor there.

paste should be one of the options under 'edit' across the top of the screen.

I am definitely using X11. Under 'edit', there are two options: Copy, and Special Characters.

If you're using X11, then you're using a graphical application. It may use the graphics to show text, but it's a graphical application.

Middle click in mac is cmd-click. You can also plug in an ordinary mouse and you'll have all the functionality Apple never thought you'd need.

Copy text ----> Vi insert mode ----> cmd-click does not work. Any other thoughts?

googling osx x11 paste found the apple faq on the subject:

Thanks, but this does not pertain to vim. I need to know how to paste text which I have copied into an open vim file.

There is not a "vim method" of pasting.

That's a function of the window system -- and the window system you're using vim in, is X11. You said so yourself. The edit options you saw -- with paste grayed out or missing -- are exactly what you'd expect of an application which uses X11 under OSX.

Even if it uses the graphics to display text, that doesn't make it not a graphical application. X11 doesn't have a "text mode".

It does, however, have a method of pasting things, which is configurable in OSX's X11 server.

Try it already. And check the options I gave you, to see what it's actually expecting.

Yes, I can easily copy and paste within X11. Thanks again, though.

Hi,

Normally if there is a copy option, once highlighted and copied there will be a paste option.

Regards

Dave

No, there appears to never be a paste option.

That's why you need to use X11's instead. That's what happens in an X11 application under OSX.

Oh, sorry. I was unclear when I said I can copy and paste within X11. I can highlight and copy text in X11, and paste it into other applications. I CANNOT paste within X11, as there is no paste option.

That's because paste functionality works differently in X11. It's not quite the same as the usual clipboard type of copy-paste, there's contexts and such which usually don't come into the usual copy-paste you see in Windows and the like. Usually, what gets selected gets copied, without a buffer -- if nothing is currently selected anywhere, there's nothing to paste. Quite different from how copy-paste works these days, and you can configure how/if it buffers these days, but that legacy is still there. Not the same, uses different mechanisms. Which is why OSX's own X11 server has its own, independent way to paste inside X11 applications. You can even configure how the X11 server treats key or mouse combinations for pasting.

For details, I refer you to my posts earlier in this thread.

Ok, I'll have a closer look... thanks!

If you are using MAC keyboard, you can use CMD (instead of Ctrl) button + V/C/X. It works for me.
MAC mouse has no middle button, in fact it has only touch and one button.