set clipboard for ssh sessions

This commit is contained in:
Oliver Hartmann 2024-05-21 10:00:27 +00:00
parent 638293d7a8
commit 42c45af705

View File

@ -50,6 +50,27 @@ if vim.fn.has('wsl') == 1 then
opt.guifont = 'RobotoMono Nerd Font:h10' opt.guifont = 'RobotoMono Nerd Font:h10'
elseif vim.loop.os_uname().sysname == 'Linux' then elseif vim.loop.os_uname().sysname == 'Linux' then
opt.guifont = 'Iosevka NFM:h11' opt.guifont = 'Iosevka NFM:h11'
if vim.env.SSH_TTY or vim.env.SSH_CLIENT or vim.env.SSH_CONNECTION then
function no_paste(reg)
return function(lines)
-- Do nothing! We can't paste with OSC52
end
end
vim.g.clipboard = {
name = 'OSC 52',
copy = {
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
},
paste = {
-- ['+'] = require('vim.ui.clipboard.osc52').paste('+'),
-- ['*'] = require('vim.ui.clipboard.osc52').paste('*'),
['+'] = no_paste('+'), -- Pasting disabled
['*'] = no_paste('*'), -- Pasting disabled
},
}
end
else else
-- opt.guifont = 'Hack Nerd Font:h10' -- opt.guifont = 'Hack Nerd Font:h10'
-- opt.guifont = 'JetBrainsMono Nerd Font:h10' -- opt.guifont = 'JetBrainsMono Nerd Font:h10'