gbprod / yanky.nvim

Improved Yank and Put functionalities for Neovim
Do What The F*ck You Want To Public License
886 stars 23 forks source link

osc52 support #113

Closed davidosomething closed 10 months ago

davidosomething commented 1 year ago

when in an ssh session, you typically don't have access to system/x11 clipboards but you can use built-in terminal emulator codes to copy things into your system clipboard via osc52

a plugin that tells nvim to use osc52: https://github.com/ojroques/nvim-osc52

in this case, i would like to be able to first yank into yanky, and then output the osc52 code (chaining on to nvim-osc52) to push the same yanked text into my system clipboard

gbprod commented 1 year ago

Interesting, I'll look at this

gbprod commented 11 months ago

Since this commit you can use osc52 as clipboard directly in Neovim nightly. Can you try with this config and send me feedback:

    vim.g.clipboard = {
      name = 'OSC 52',
      copy = {
        ['+'] = require('vim.clipboard.osc52').copy,
        ['*'] = require('vim.clipboard.osc52').copy,
      },
      paste = {
        ['+'] = require('vim.clipboard.osc52').paste,
        ['*'] = require('vim.clipboard.osc52').paste,
      },
    }

If it works, we could add a section in the readme :)