Alex Rivera | Logout

selecting in visual mode to paste outside vim window

Asked 2011-10-12T23:41:52.877
22

I need to paste some selected block in visual mode to outside of vim. Currently I need to select this block manually from mouse to paste outside of vim.

As selecting texts in visual mode is easier ,it would be efficient to select some text for pasting outside of vim.

Edit
Report

2 Answers

28

You could yank the text into the + (plus) register, that is mapped to the system clipboard. Just select the text in the mode you like and then type "+y.

answered 2011-10-12T23:50:27.380
6

You can bind contents of the visual selection to system primary buffer (* register in vim, usually referred as «mouse» buffer) by using

set clipboard^=autoselect
answered 2011-10-13T04:07:48.070

Your Answer