Wednesday, November 3, 2010

How to copy text from vim to clipboard in Linux

Hi,

I am using vim on different, remote Linux systems, and what I would like to do is to copy some text in vim into the clipboard, so I can paste the text in some other application (i.e. xterm, email, emacs, openofice...). I do not have the possibility to recompile vim, as I would need to do that on several different machines I do not have root access.

For example, I want to copy 3 lines from my vim session, so I can paste it into my email program by using either (i) the middle button of the mouse or (ii) by ordinary select 'paste' from the right-button mouse menu or the application's edit menu.

I searched for doing so and got hints like using "+y after selecting the text or using "*y, but these suggestions do not work. I even put the line "set clipboard=unnamed" into my .vimrc without changing the behavior.

Is there a way to do this WITHOUT the need for a recompilation? Or maybe I can put something useful into the .vimrc so something like that works? Or can I forget about this idea?


Thanks
  Alex

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: