fix clipboard

This commit is contained in:
Christian Nieves
2023-08-04 18:47:09 +00:00
parent 3d223ff976
commit b1d1bb9e32
5 changed files with 23 additions and 43 deletions

View File

@ -0,0 +1,22 @@
return {
"ojroques/nvim-osc52",
config = function()
local function copy(lines, _)
require("osc52").copy(table.concat(lines, "\n"))
end
local function paste()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end
vim.g.clipboard = {
name = "osc52",
copy = { ["+"] = copy, ["*"] = copy },
paste = { ["+"] = paste, ["*"] = paste },
}
-- Now the '+' register will copy to system clipboard using OSC52
-- vim.keymap.set("n", "<leader>c", '"+y')
-- vim.keymap.set("n", "<leader>cc", '"+yy')
end,
}