Skip to content

Commit

Permalink
nvim: remove nvim-osc52 in favour of builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
FredeHoey committed Dec 5, 2023
1 parent 2a84b6d commit b6d328f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
25 changes: 9 additions & 16 deletions nvim/.config/nvim/after/plugin/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,18 @@ vim.api.nvim_create_autocmd('WinEnter', {
vim.notify = require('notify')

-- osc52
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 },
name = 'OSC 52',
copy = {
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
},
paste = {
['+'] = require('vim.ui.clipboard.osc52').paste('+'),
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
},
}

-- Now the '+' register will copy to system clipboard using OSC52
vim.keymap.set('n', '<leader>c', require('osc52').copy_operator, { expr = true })
vim.keymap.set('n', '<leader>cc', '<leader>c_', { remap = true })
vim.keymap.set('x', '<leader>c', require('osc52').copy_visual)

m.keys {
{ 'n', '<leader>t', require('tardis-nvim').tardis }
}
Expand Down
1 change: 0 additions & 1 deletion nvim/.config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ require('lazy').setup {
{ 'neogitorg/neogit' },
-- misc
{ 'rcarriga/nvim-notify' },
{ 'ojroques/nvim-osc52' },
{ 'olimorris/persisted.nvim' },
{ 'windwp/nvim-autopairs', config = true },
{ 'numToStr/Comment.nvim', config = true },
Expand Down

0 comments on commit b6d328f

Please sign in to comment.