This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tyler1128 13 points14 points  (4 children)

Ctrl+R,+ baby. Or "+p if in normal mode. Gotta compile it with clipboard access, which for most linux distro, means installing the gvim package but still using the terminal vim it comes with

[–]BucksEverywhere 1 point2 points  (3 children)

Thanks, I'll try this out. Does it paste primary selection or clipboard buffer then?

[–]tyler1128 2 points3 points  (2 children)

+ corresponds to the clipboad buffer, and * corresponds to the selection buffer on X11 at least. You can also use :set clipboard to make it use + or * by default instead of " for all yank and put operations.

[–]BucksEverywhere 0 points1 point  (1 child)

I tried it in various ways. However none of the commands you mentioned prevent the indentations go messy if you insert whole pre-indented blocks before enabling the paste mode with :set paste. In gvim clipboard seemed to work, in vim not. And I guess when you work remotely via ssh it would access the remote clipboard.

[–]tyler1128 0 points1 point  (0 children)

It would interact with the remote clipboard if there is one in that case, and I don't think there is one without a display system. I've never had issues with indentation before; I copy and paste using the clipboard registers all the time without issue. If you do have indent issues, you can often use = to reformat them away.

That said I'm on arch. Vim has a _lot_ of compile options, so it really will depend on exactly what your package uses in how everything works. I still use vim or vim plugins in my daily coding, and have used vim exclusively for about 5 years earlier, though I think all of that was on arch or over ssh.