osc52 for remote env clipboard

This commit is contained in:
Thomas Smallwood 2025-11-24 13:14:20 +01:00
parent 78786ce1aa
commit e24151ddf9
No known key found for this signature in database
2 changed files with 20 additions and 0 deletions

View file

@ -20,6 +20,7 @@
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lint": { "branch": "master", "commit": "d1118791070d090777398792a73032a0ca5c79ff" },
"nvim-lspconfig": { "branch": "master", "commit": "a2a277114dbb93e98f04b5087a9b832918b7da15" },
"nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" },
"nvim-treesitter": { "branch": "main", "commit": "bb83a676128d95c865e40ba71376d883bdadec14" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "227165aaeb07b567fb9c066f224816aa8f3ce63f" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },

19
lua/plugins/osc52.lua Normal file
View file

@ -0,0 +1,19 @@
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,
},
}