On Nov 6, 3:40 pm, Linda W <[EMAIL PROTECTED]> wrote:
> It's sorta embarassin', but I don't know how to copy Selected-text to the
> clipboard under Windows using the keyboard (i.e. Not going up to Edit, and
> using 'Copy').
>
> It DOES give a keyboard shortcut that it tells me I can use:
> "+y  (double quote, + y)
>
> I've tried holding down D)ouble Q)uote and pressing 'y' at the same time, that
> (like Ctrl+y or Ctrl-y)
> I've tried pushing the DQ, and y in succession.
> I've tried DQ, the '+' key and 'y' -- simultaneously and in succession...
> none of them work.
>
> is DQ supposed to be some thing meta-key my keyboard doesn't have?
>
> Sorry -- I'm just not getting this "+y
>
> thanks,.....

What this is telling you, is that you need to use the "y" normal-mode
command, with the "+" register.

Just pressing the 'y' key in normal mode (I assume you're not using
Vim's "Easy Mode" or something similar) will wait for you to enter a
motion or text object. When you do so (for example, typing yiw to yank
an entire word), the text you selected with the motion or text object
is "yanked" into the "unnamed" register. You can later put (a.k.a.
"paste") this text with p or P.

Rather than using a motion or text object, you can also select text in
visual or selection mode, and press y to yank the selected text.

Now, this is all very useful, but it only works from within Vim. You
can, however, use a large number of registers _other_than_ the
"unnamed" register. You access these other registers by first typing
the quote character ("), and then the name of the register, before
typing the y.

For example, to yank a word to register a, it's this command (type
every character in normal mode):
"ayiw

Two of the registers available are the * and + registers, which access
the system clipboard. In Windows, these two registers are the same,
you can use either. On other systems, the * register is the
"selection" register (think middle-clicking to paste in many Linux
systems) and the + register is the clipboard (your CTRL-C/CTRL-V in
applications other than Vim). You use these two registers as any other
register:

"+yiw

will yank the word under the cursor to the system clipboard.

Put (the p or P command) similarly take a register, so to paste
something you copied elsewhere into Vim, it's:

"+p

It is possible to use the system clipboard by default, instead of the
unnamed register. See :help 'clipboard'

For a list of all registers available (which opens up many new
powerful techniques) see :help registers

The following may also interest you:

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

Reply via email to