On 27/02/09 02:51, Tim Johnson wrote:
> Using vim and gvim 7.1 on kubuntu 7.10
> I've used vim for years, gvim, more recently.
>
> In vim, when I make a selection with my pointing device,
> whether in a file window or in the command line,
> that selection is always copied to the clipboard.
> ==============
> That's a good thing.
> ==============

IMHO, it's a bad thing, but it's user-configurable by means the 
'clipboard' option, as follows:

        X11 default: "autoselect,exclude:cons\|linux"
        non-X11 default: ""
        I use: "", even in gvim on Linux
        "unnamed" makes everything yanked to "" appear on "*

>
> However, I note that in gvim, sometimes the selection
> is copied to the clipboard and sometimes it is not, I can
> always "force" a copy from a window to the clipboard with
> "+y , but that doesn't seem to work in the ex command line.

On the ex-command line, use

        :[range]y[ank] +

which, like all ex-commands, is always linewise. When called from Visual 
mode, Vim will insert the range '<,'> to yank all lines affected by the 
Visual selection.

>
> As with vim, I would like _any_ pointing device selection in gvim
> to copy to the clipboard.( In ubuntu, that is klipper)
>
> The same annoying situation occurs for gvim whether
> guioptions=aegimrLtT or
> guioptions=aegimt
> my vim settings for guioptions are aegimrLtT
>
> I looked at :h guioptions, and :h clipboard, from what I
> read, I can't deduce a fix for this problem.

What is 'clipboard' set to when you run Vim in Console mode on the 
Alt-Ctrl-F2 non-X11 terminal? (Come back with Alt-Ctrl-F7.) When you run 
it in some terminal emulator such as xterm, konsole or gnome-terminal? 
When you run gvim (in GUI mode)? You might want to set it (a 
comma-separated list) to one or more of the following:

unnamed         all yanks go to "* (which is not the same as "+), paste
                by MiddleMouse
autoselect      like "a" in 'guioptions': all Visual selections go to "*
                (which, on X11, is not the same as "+, see above
exclude=cons\|linux
                not if running on a terminal with no connection to X11

>
> Any help is appreciated.
> thanks
> tim

Maybe you're confusing the two X11-related registers:

"+ is the clipboard.
- In most applications:
        copy by Edit=>Copy or Ctrl-C
        cut by Edit=>Cut or Ctrl-X
        paste by Edit=>Paste or Ctrl-V
- In Vim (in the same sequence but in Vim terminology):
        yank by "+y or :y+
        delete by "+d or :d+
        put by "+p "+P or :put+
All three ex-commands mentioned above accept a range, which is the range 
to be copied for :y or :d, or after which to put (0 for "before line 1") 
for :put.
- In gvim: same as in Vim, or, in addition, use Edit=>Copy, Edit=>Cut, 
Edit=>Paste as in any other app.

"* is the X11 selection.
- In most applications: copy by selecting, paste by MiddleMouse.
- In Vim: as for the clipboard, but replace everywhere + by *
- In addition, when you have a functioning mouse recognised by Vim 
(which is  not always the case in Console mode): paste by MiddleMouse, 
unless another register is prefixed.

When the selection register is empty, and Vim tries to paste from it, it 
will use the clipboard.

On non-X11 operating systems such as Windows, "+ and "* become 
synonymous in Vim.



Best regards,
Tony.
-- 
FROG: How you English say:  I one more time, mac, I unclog my nose towards
       you, sons of a window-dresser,  so, you think you could out-clever us
       French fellows with your silly knees-bent creeping about advancing
       behaviour.  (blows a raspberry) I wave my private parts at your 
aunties,
       you brightly-coloured, mealy-templed, cranberry-smelling, electric
       donkey-bottom biters.
                  "Monty Python and the Holy Grail" PYTHON (MONTY) 
PICTURES LTD

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to