Thursday, November 8, 2012

Re: basic vim usage

On 2012-11-08, Suresh Govindachar wrote:
> On 11/8/2012 5:22 AM, stosss wrote:
>
> > Linux has the ability to copy without using a copy command. Simply
> > high lite the text you want and then place the curse where you want to
> > paste that text and just click the middle mouse button. This is
> > available system wide on Linux maybe Mac too but no at all on windows.
>
> That actually works on my Windows gvim: In normal mode: highlight
> some text, move mouse to some place and press middle button: stuff
> that was highlighted gets pasted.
>
> Also, highlight some text in normal mode, hit "<esc>", go to some
> other place (perhaps using ijkl keys), hit "p" (to put the
> highlighted text at current location).

Yes, this does work very well.

With a version of vim that has +clipboard, +X11 and +xterm_clipboard
features and a ~/.vimrc that has

set mouse=a
set clipboard^=unnamed

you can copy and paste between different instances of vim, gvim and
other applications running in Windows or in X11 on Linux using any
of the techniques discussed here, including the traditional X11
left-click-to-copy, middle-click-to-paste, in normal and insert
modes.

One thing to be careful of: some Linux distributions build separate
binaries for vim and gvim and their vim build does not include
support for X11 or the clipboard. So make sure you are using a vim
with that support. A workaround for this is to use "gvim -v". This
will execute the gvim binary, giving you X11 support, but as a
terminal application, i.e. just like "vim".

Having said all that, I will agree with Tim that including "unnamed"
in 'clipboard' may not be what you want. The advantage is that
everything you select goes to the clipboard. The disadvantage is
that everything you select goes to the clipboard. The result is
that it either "just works" or drives you nuts, depending on your
expectations.

HTH,
Gary

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