Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is no standard way for Vim to distinguish whether an input character was actually typed by user or generated for him/her by X from clipboard or selection buffer. That's why there is paste mode to manually switch Vim into the state when all input is not interpreted as interactively typed.</p> <p>Thus, you have two alternatives.</p> <ol> <li><p>Paste from <code>"*</code> or <code>"+</code> pseudo-buffers (that represent clipboard and X selection respectively), <em>if you are using GVim or your Vim compiled with <code>X11</code> feature (or at least <code>xterm_clipboard</code>)</em>. It's just that simple.</p></li> <li><p>In case of console Vim running in terminal, you can manually synchronize one of the buffers (for example, unnamed register <code>""</code>) with clipboard or X selection. For instance, since I use terminal Vim only, I have the following mappings in my <code>.vimrc</code> file:</p> <pre><code>nmap &lt;silent&gt; &lt;leader&gt;y :call system('xclip', @")&lt;cr&gt; nmap &lt;silent&gt; &lt;leader&gt;p :call XClipRead()&lt;cr&gt; function! XClipRead() let s = system('xclip -o') if v:shell_error return endif call setreg('"', s) endfunction </code></pre> <p>To paste X selection buffer contents using these mappings you need to type you leader key, <code>p</code>, and then an appropriate Vim paste command. If you agree to lose the opportunity of using different paste commands (such as <code>P</code>, <code>gp</code>, <code>]p</code>, etc), you can define a mapping that does both things. For example,</p> <pre><code>nmap &lt;silent&gt; &lt;leader&gt;P :call XClipRead()&lt;cr&gt;p </code></pre></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload