Quantcast
Channel: How can I make Vim paste from (and copy to) the system's clipboard? - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Answer by The Demz for How can I make Vim paste from (and copy to) the system's clipboard?

$
0
0

clipboard

There is a special register for storing this selection, it is the "*register. Nothing is put in here unless the information about what text isselected is about to change (e.g. with a left mouse click somewhere), or whenanother application wants to paste the selected text. Then the text is putin the "* register. For example, to cut a line and make it the currentselection/put it on the CLIPBOARD:

"*dd

Similarly, when you want to paste a selection from another application, e.g.,by clicking the middle mouse button, the selection is put in the "* registerfirst, and then 'put' like any other register. For example, to put theselection (contents of the CLIPBOARD):

"*p

registersE354

> There are nine types of registers:                      > 1. The unnamed register ""> 2. 10 numbered registers "0 to "9> 3. The small delete register "-> 4. 26 named registers "a to "z or "A to "Z> 5. four read-only registers ":, "., "% and "#> 6. the expression register "=> 7. The selection and drop registers "*, "+ and "~ > 8. The black hole register "_> 9. Last search pattern register "/

Paste from clipboard

1. Clipboard: Copy2. Vim insertmode, middle mouse key

Check for X11-clipboard support in terminal

When you like to run Vim in a terminal you need to look for a version of Vim that was compiled with clipboard support.Check for X11-clipboard support, from the console, type:

% vim --version

If you see "+xterm_clipboard", you are good to go.

http://vim.wikia.com/wiki/Accessing_the_system_clipboard

The X server maintains three selections, called:

PRIMARY, SECONDARY and CLIPBOARD

The PRIMARY selection is conventionally used to implement copying and pasting via the middle mouse button. The SECONDARY and CLIPBOARD selections are less frequently used by application programs.

http://linux.die.net/man/1/xsel


Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>