1

I have NVIM v0.4.3 installed on Debian 10. When I run:

:echo has('clipboard')

I get 0, which means that this extension is not available. I cannot copy to OS clipboard using "+y and "*y commands.

How could I install or make this extension available?

Update :help clipboard shows:

Clipboard integration

provider-clipboard clipboard

Nvim has no direct connection to the system clipboard. Instead it depends on a provider which transparently uses shell commands to communicate with the system clipboard or any other clipboard "backend".

To ALWAYS use the clipboard for ALL operations (instead of interacting with the '+' and/or '*' registers explicitly):

set clipboard+=unnamedplus

See 'clipboard' for details and options.

clipboard-tool

The presence of a working clipboard tool implicitly enables the '+' and '*' registers. Nvim looks for these clipboard tools, in order of priority:

Which of these providers could work in Debian Docker container? It seems that only tmux is suitable, however I have to start tmux session to use it. I have tried xclip, but probably $DISPLAY is not set in the container and it does not work.

3
  • 1
    I have read the clipboard help, but still don't understand how to make clipboard work. My environment is in Docker container, I have installed xclip, but still no effect, cannot use +, * registers.
    – niekas
    Feb 20, 2021 at 15:42
  • 2
    This problem is really frustrating. Has anybody found a proper solution for this? I am also stuck at this point without any solution Apr 13 at 17:03
  • For NeoVIM 10+ there is a built-in workaround, see: :h clipboard-osc52. For older versions these plugins could be used: github.com/ojroques/nvim-osc52 and github.com/ojroques/vim-oscyank
    – niekas
    19 hours ago

1 Answer 1

1

Linux does not provide any system clipboard. Therefore you can't make use of it.

See, for example, Access Unix Clipboard for explanation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.