I run linux via VirtualBox on OS X where I edit in vim. I do this by running my VM in a headless state and then sshing to the linux machine using port forwarding. Is there any way to yank text in visual mode so that what's yanked is put into my local clipboard?
hit Ctrl + V on the keyboard. use the keyboard to access the context menu's Edit > Paste option: Alt + Space , then E , then P. if the "Use Ctrl+Shift+C/V as Copy/Paste" option is activated, hitting Ctrl + Shift + V on the keyboard.
Make sure that (1) your Vims on both sides are compiled with +xterm_clipboard
, and (2) you have X11 forwarding enabled through ssh. Then set clipboard
to unnamedplus,autoselect
in your vimrcs on both sides:
set clipboard=unnamedplus,autoselect,exclude:cons\\\\|linux
With this you should be able to yank text from a Vim on the guest and paste it to a Vim on the host, and the other way around, provided that the two Vims are running at the same time and the ssh connection is still open.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With