Wednesday, November 3, 2010

Re: How to copy text from vim to clipboard in Linux

On 11/03/10 08:20, Alexander Dietz wrote:
> I think the code has been compiled without clipboard support. I see only a
> '-clipboard'

indeed

> I have tried vim which gave the negative result as described above.

If you have gvim (you've already confirmed that "vi" and "vim"
launch a "-clipboard" version of vim) you can launch it with the
"-v" parameter (-v = "pretend you're vim, not gvim"), or try
linking gvim to the name "vim" or "vi" earlier in your $PATH.

If you really don't have an X-aware build of vim available at all
(I'm sorry!), you'll have to rely on external mechanisms.

> xclip also does not seem to be installed on the different systems.
>
> Any other idea I can try out, instead of quitting vi, doing a 'cat file',
> search for the place to copy, and manually copy with the mouse?

Well, you can limit the amount of output you have to wade through
by writing just that excerpt to a file

:'<,'>w temp_file.txt

and then read it in with some other clipboard-aware program (or
cat it to the screen, but then you're limited to the size of your
terminal's scroll-back).

Alternatively, if you have build-tools, Tony maintains a good
"how to compile vim on Unix/Linux" page[1] and you could build
Vim in your home directory (what I've done on several shared
hosting services that only gave me vim-minimal).

-tim


[1]
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
further info at
http://users.skynet.be/antoine.mechelynck/vim/index.htm

--
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: