home: vim: add 'nvim-osc52'
All checks were successful
continuous-integration/drone/push Build is passing

I do get the message when copying into the clipboard while ssh-ing.

But trying to paste from my system clipboard shows that it did *not* get
copied. This seems to only happen inside tmux.

However tmux itself *does* copy to the clipboard correctly through OSC52.
This commit is contained in:
Bruno BELANYI 2023-02-12 12:36:50 +01:00
parent fe73a304aa
commit 2ffb8e6ee6
2 changed files with 18 additions and 0 deletions

View file

@ -60,6 +60,7 @@ in
# General enhancements
vim-qf # Better quick-fix list
nvim-osc52 # Send clipboard data through terminal escape for SSH
# Other wrappers
git-messenger-vim # A simple blame window

View file

@ -0,0 +1,17 @@
if not require("ambroisie.utils").is_ssh() then
return
end
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},
}