0

For the bare version of Vim that comes with WSL on Windows 10, attempts to "yank to registry *" will fail with the following error message:

enter image description here

One way to reproduce the symptom is to assign the following mapping, and invoke it by pressing Y in normal mode.

nnoremap Y :let @* = expand("%:p")<CR>
llinfeng
  • 1,368

1 Answers1

2

Short solution

In reference to the discussion here, installing a "full" version of Vim through apt-get install vim-gtk solves the trouble.

Longer explanation

WSL on Windows 10 is shipped with the basic version of Vim, which does not have clipboard support.

  • To verify this, executing :echo has('clipboard') will yield 0.

Installing the vim-gtk equips Vim with the clipboard functionality.

llinfeng
  • 1,368