fix(nvim): osc52 yank

This commit is contained in:
Tine 2024-01-31 23:32:03 +01:00
parent d7cb163dd3
commit b06f7563b1
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw

View file

@ -52,15 +52,15 @@ require("osc52").setup({
silent = false,
tmux_passthrough = true,
})
vim.opt.clipboard:append({ "unnamed", "unnamedplus" })
function copy()
if vim.v.event.operator == "y" and vim.v.event.regname == "+" then
if vim.v.event.operator == "y" and vim.v.event.regname == "" then
require("osc52").copy_register("+")
end
if vim.v.event.operator == "d" and vim.v.event.regname == "+" then
if 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 })
-- Misc