diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 6cdfd79..1eb5316 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -196,6 +196,13 @@ return require("packer").startup(function() end, }) + use({ + "ojroques/nvim-osc52", + config = function() + require("plugins/osc52") + end, + }) + -- marks use({ "chentoast/marks.nvim", diff --git a/.config/nvim/lua/plugins/osc52.lua b/.config/nvim/lua/plugins/osc52.lua new file mode 100644 index 0000000..620b41b --- /dev/null +++ b/.config/nvim/lua/plugins/osc52.lua @@ -0,0 +1,10 @@ +local osc52 = require("osc52") +osc52.setup({ + max_length = 0, -- Maximum length of selection (0 for no limit) + silent = false, -- Disable message on successful copy + trim = false, -- Trim text before copy +}) + +vim.keymap.set("n", "c", require("osc52").copy_operator, { expr = true }) +vim.keymap.set("n", "cc", "c_", { remap = true }) +vim.keymap.set("x", "c", require("osc52").copy_visual)