Code Monkey home page Code Monkey logo

Comments (3)

ojroques avatar ojroques commented on May 24, 2024

Hello!

You have two options:

  1. Set the clipboard provider of Neovim to use the plugin, see the instructions here. Basically it tells Neovim that your "+" register should now call the plugin. The most natural solution in my opinion but you'd need to change your mappings to use the "+" register.
  2. Keep your autocmd but call this function instead:
    function M.copy_register(register)
    with 'c' as argument. So something like (using the new API for autocmd):
function copy()
  if vim.v.event.operator == 'y' and vim.v.event.regname == 'c' then
    require('osc52').copy_register('c')
  end
end

vim.api.nvim_create_autocmd('TextYankPost', {callback = copy})

from nvim-osc52.

cseickel avatar cseickel commented on May 24, 2024

Thanks! The second option is exactly what I was looking for. I like it that way because I liked having an easy to use second register (Control-c/x/v) and I didn't want to oscyank every time. Now that i think about more though, maybe using the plus register for that makes more sense, and I can just not copy to plus with the unnamed register.

Either way, thanks for the help and the incredibly useful plugin!

from nvim-osc52.

ojroques avatar ojroques commented on May 24, 2024

Glad you find it useful!

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.