cutlass.nvim icon indicating copy to clipboard operation
cutlass.nvim copied to clipboard

visual selection & p vs. P

Open Matzeall opened this issue 1 month ago • 0 comments

First of all thanks for creating this plugin, I am currently in my second rewrite of my config and probably would have dropped Neovim completely my first time around if not for this plugin :D

I hope you can help me understand what is happening in nvim that pasting over a selection with p still somehow finds a way to end up in my yank register even though delete, change & select are already routed into nothingness.

Is there some way to also route pasting over a selection to "_"? I wish there would be settings for this on a neovim level. Otherwise I think it would be a good addition to this plugin aswell, if there is a good plugin-level solution for it, that is.

I cannot just remap p to P too, since I already map yanky.nvim's instructions on p & P (and I have no easy way to control what they use internally)

            ["p"] = { "<Plug>(YankyPutAfter)", desc = "Put yanked text after cursor" },
            ["P"] = { "<Plug>(YankyPutBefore)", desc = "Put yanked text before cursor" },

I can somewhat fix the issue by prefixing mappings, that use p in visual mode, with "_d<actual_mapping>, but that also creates some problems of it's own in some cases. Those I can handle for now though.

            ["p"] = { '"_d<Plug>(YankyPutBefore)', desc = "Put yanked text after cursor" },
            ["P"] = { '"_d<Plug>(YankyPutBefore)', desc = "Put yanked text before cursor" },

Is there a better way on a lower level?

Matzeall avatar Nov 01 '25 22:11 Matzeall