From b6ab54838c79c314ad62ecf379253eacdfa804e5 Mon Sep 17 00:00:00 2001 From: Max Reed Date: Sun, 23 Feb 2025 14:39:14 +0100 Subject: [PATCH] added osc for ssh clipboard functionality --- lua/custom/plugins/nvim-osc52.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lua/custom/plugins/nvim-osc52.lua diff --git a/lua/custom/plugins/nvim-osc52.lua b/lua/custom/plugins/nvim-osc52.lua new file mode 100644 index 00000000..d3fbc39e --- /dev/null +++ b/lua/custom/plugins/nvim-osc52.lua @@ -0,0 +1,18 @@ +return { + + 'ojroques/nvim-osc52', + config = function() + require('osc52').setup { + max_length = 0, -- Maximum length of selection (0 for no limit) + silent = false, -- Disable message on successful copy + trim = false, -- Trim surrounding whitespaces before copy + } + local function copy() + if (vim.v.event.operator == 'y' or vim.v.event.operator == 'd') and vim.v.event.regname == '' then + require('osc52').copy_register '' + end + end + + vim.api.nvim_create_autocmd('TextYankPost', { callback = copy }) + end, +}