Add OCS-52 module

For accessing clipboard over ssh
This commit is contained in:
40DEEA 2025-10-21 22:44:42 -07:00
parent a3155f4351
commit 5aac9c0a63
3 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,20 @@
return {
'ojroques/nvim-osc52',
event = 'VeryLazy',
opts = { max_length = 0, silent = true },
config = function(_, opts)
require('osc52').setup(opts)
-- Send *any* yank to the local clipboard automatically
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
if vim.v.event.operator == 'y' then
require('osc52').copy_register(vim.v.event.regname == '' and '"' or vim.v.event.regname)
end
end,
})
-- Optional: explicit mappings
vim.keymap.set({ 'n', 'x' }, '<leader>y', require('osc52').copy_visual, { desc = 'Yank→local clipboard' })
end,
}