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

Allow setting a default register for Myank

Open ibash opened this issue 11 months ago • 3 comments

I am on macos I have my clipboard set to the system clipboard with vim.opt.clipboard = "unnamed".

This change lets you set the default register for Myank (so I can yank to system clipboard).

ibash avatar Feb 06 '25 04:02 ibash

Hey! Yank to system is implemented but it was undocumented. You can choose the register as the first argument to Myank, so :'<,'>Myank * (visual select + Myank) should put the text in your system clipboard. Let me know if that works.

gsuuon avatar Feb 06 '25 15:02 gsuuon

Sorry for the delay here. Yep setting the register as the first argument works, but I found it less convenient than being able to set a default. I also didn't find a way to just rewrap the command but I'm not super strong with vim.

ibash avatar Feb 27 '25 19:02 ibash

You could add a vmap like so: vmap <leader>y :Myank *<CR>. Though it might be good to make including diagnostics configurable?

gsuuon avatar Mar 03 '25 19:03 gsuuon

Closing with docs update in a0de027

gsuuon avatar May 19 '25 18:05 gsuuon