You are not logged in.

#1 2020-05-22 06:09:31

Bradan
Member
Registered: 2015-10-13
Posts: 21

[Solved] Wayland/Gnome/ssh/vim: clipboard annoys me sometimes

Hello,

Every now and then the clipboard doesn't really work consistently.

I'm currently having one gnome-terminal window with two tabs, each on a remote ssh session open to one computer. The first one shows vim, the second one is for utility commands.

I select something, e.g. a mac address, s.t. it should be inside primary. This should be pastable via middle mouse click. Inside a local sublime text it works perfectly fine, but inside remote vim, it pastes something I had not in mind ever.

Here is a short video, which shows the problem: https://youtu.be/eGkrAUpD7jI

What is wrong there?

Kind regards,
Daniel

Last edited by Bradan (2020-05-22 07:01:11)

Offline

#2 2020-05-22 07:00:52

Bradan
Member
Registered: 2015-10-13
Posts: 21

Re: [Solved] Wayland/Gnome/ssh/vim: clipboard annoys me sometimes

Oh I found the error: vim has mouse=a on the remote session, I disabled it for some users but not globally.

Last edited by Bradan (2020-05-22 07:01:24)

Offline

#3 2020-09-12 08:31:28

icar
Member
Registered: 2020-07-31
Posts: 562

Re: [Solved] Wayland/Gnome/ssh/vim: clipboard annoys me sometimes

Hello, I'm having the same problem. I cannot make vim use the Wayland clipboard. I've, so far, tried adding

xnoremap "+y y:call system("wl-copy", @")<cr>
nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p

to my vimrc and installing community/wl-clipboard ... With no luck.

I came across this post and I have mouse=a also in my rc file, so I tried commenting that out with no luck neither.

So, it still happens: I can copy and paste to/from my programs except for vim. Of course, I can go into insert mode and Ctrl+C/Ctrl+V, but that's beyond the point. The `p` doesn't work.

Edit (after quite some time): instead of "+y or similar, remove the characters so that it's just the p or the y. This is how you make it work.

Last edited by icar (2020-10-17 10:54:00)

Offline

Board footer

Powered by FluxBB