1

I wanted to set the system clipboard for nvim but all the instructions I find on the net do not work.

I already set clipboard=unnamedplus:

:verbose set clipboard? clipboard=unnamedplus

but still nvim says that clipboard has no provider.

In this distribution there are no packages named xclip, xsel or wl-clipboard. Snap has a package wl-clip, I installed it but still is not working.

David DE
  • 2,385
Jimmi
  • 11

1 Answers1

0

Same issue on Ubuntu LTS 24.04.

$ nvim -V1 -v
NVIM v0.11.4
Build type: Release
LuaJIT 2.1.1741730670

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

and

:checkhealth # inside nvim returns:
vim.prodived:
- WARNING No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.
  - ADVICE:
    - :help clipboard

as @Jimmy, I define set clipboard=unnamedplus

Is wayland the reason ?
Check first if you use wayland or X11 :
echo "$XDG_SESSION_TYPE"
if you always are in x11, install:
sudo apt install xclip then change my vimrc config file:

set clipboard=unnamedplus
# become
let clipboard="xclip"

Perhaps if you are under wayland test install:
sudo apt install wl-clipboard (src: https://ramezanpour.net/post/2022/07/24/access-os-clipboard-in-neovim)
then change your vimrc config file : let clipboard="wl-copy"

bcag2
  • 471