feat(nvim): add osc52 support for clipboard

This commit is contained in:
Price Hiller 2022-07-25 13:51:32 -05:00
parent b65e93bfac
commit da9ea8f025

View File

@ -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