Giter Site home page Giter Site logo

Comments (7)

desilinguist avatar desilinguist commented on June 14, 2024

Something I just noticed: yy does copy because I see the message from osc52 when I do it. It's just the paste with p that doesn't work.

from nvim-osc52.

ojroques avatar ojroques commented on June 14, 2024

When you set vim.opt.clipboard = "unnamedplus", you instruct Neovim to put all your yanked text into the + register, which in turn calls the copy() function with the given text. But Neovim still puts the text into your unnamed register " as well. So when you copy text inside Neovim then use p, it should work fine. Did you remap y or yy in your config?

Or did you mean copying text from outside Neovim and pasting inside with p? Unfortunately this case is not supported by most terminal emulators, because letting applications read the clipboard is a security issue. In that case I suggest you use the plugin only to copy, and use your default clipboard provider for pasting. So if you want to copy with <leader>c:

vim.opt.clipboard = 'unnamedplus'
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)

Also note that if you don't change any of the default options, you don't need to call setup().

from nvim-osc52.

ojroques avatar ojroques commented on June 14, 2024

I've updated the README to address your question, but you can re-open this issue if you still have problems.

from nvim-osc52.

desilinguist avatar desilinguist commented on June 14, 2024

I was actually referring to text copied from inside neovim and pasting inside neovim. I already use Kitty's keybinding to paste from external applications. Thanks for suggesting that there may be a conflicting remap ... I removed whichkey from my plugin list and yy+p works again! So, whichkey must be remapping it somehow.

from nvim-osc52.

desilinguist avatar desilinguist commented on June 14, 2024

I think this issue may be related: folke/which-key.nvim#202

from nvim-osc52.

desilinguist avatar desilinguist commented on June 14, 2024

Yes, indeed. If I fix my local copy of whichkey with the fix suggested in the above issue, yy+p within neovim works fine and so does the integration with the system clipboard. Thanks again for your help!

from nvim-osc52.

ojroques avatar ojroques commented on June 14, 2024

Good to know! Glad that your problem is resolved.

from nvim-osc52.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.