Files
dotfiles/vim/.vim/lua/plugins/oscyank.lua
Christian Nieves d8414570a1 clipboard
2023-09-15 17:43:45 +00:00

23 lines
547 B
Lua

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>y", '"+y')
vim.keymap.set("n", "<leader>yy", '"+yy')
end,
}