diff --git a/.config/nvim/lua/plugins/plugins.lua b/.config/nvim/lua/plugins/plugins.lua index 5779c524..7040e6ea 100755 --- a/.config/nvim/lua/plugins/plugins.lua +++ b/.config/nvim/lua/plugins/plugins.lua @@ -726,6 +726,28 @@ return packer.startup({ end, }) + -- Allows yanks without a clipboard provider on OSC52 compliant + -- terminals + use({ + 'ojroques/nvim-osc52', + config = function() + require('osc52').setup({}) + 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 }, + } + end, + }) + -- Leave at end!!! -- Install and deploy packer plugins -- automatically