Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/usr_09.txt`
0f566a8b3d38bfb1b17a2fa28635cb3f0ea33edd068b4f7d000000010000092a
 highlighted.  In Vim this is the Visual area (this assumes you are
using the default option settings).  You can paste this selection in another
application without any further action.
   For example, in this text select a few words with the mouse.  Vim will
switch to Visual mode and highlight the text.  Now start another gvim, without
a file name argument, so that it displays an empty window.  Click the middle
mouse button.  The selected text will be inserted.

The "current selection" will only remain valid until some other text is
selected.  After doing the paste in the other gvim, now select some characters
in that window.  You will notice that the words that were previously selected
in the other gvim window are displayed differently.  This means that it no
longer is the current selection.

You don't need to select text with the mouse, using the keyboard commands for
Visual mode works just as well.


THE REAL CLIPBOARD

Now for the other place with which text can be exchanged.  We call this the
"real clipboard", to avoid confusion.  Often both the "current selection" and
the "real clipboard" are called clipboard, you'll have to get used to that.
   To put text on the real clipboard, select a few different words in one of
the gvims you have running.  Then use the Edit/Copy menu entry.  Now the text
has been copied to the real clipboard.  You can't see this, unless you have
some application that shows the clipboard contents (e.g., KDE's Klipper).
   Now select the other gvim, position the cursor somewhere and use the
Edit/Paste menu.  You will see the text from the real clipboard is inserted.


USING BOTH

This use of both the "current selection" and the "real clipboard" might sound
a bit confusing.  But it is very useful.  Let's show this with an example.
Use one gvim with a text file and perform these actions:

-  Select two words in Visual mode.
-  Use the Edit/Copy menu to get these words onto the clipboard.
-  Select one other word in Visual mode.
-  Use the Edit/Paste menu item.  What will happen is that the single selected
   word is replaced with the two words from the clipboard.
-  Move the mouse pointer somewhere else and click the middle button.  You
   will see that the word you just overwrote with the clipboard is inserted
   here.

If you use the "current selection" and the "real clipboard"

Title: Working with the 'Current Selection' and the 'Real Clipboard' in gVim
Summary
This section explains the distinction between the 'current selection' (Visual area) and the 'real clipboard' in gVim, particularly within X-Windows. It describes how the 'current selection' allows for immediate pasting with the middle mouse button and how the 'real clipboard' requires explicit copying. It also provides an example demonstrating the simultaneous use of both for text manipulation.