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"