nvim-miniyank icon indicating copy to clipboard operation
nvim-miniyank copied to clipboard

Miniyank conflicts with auto save autocmd

Open 0xC0FFEE opened this issue 7 years ago • 3 comments

I'm observing a conflict between my auto save autocmd and miniyank. Instead of cycling though the yank stack nothing seems to happen.

Here is the autocmd in question:

augroup auto_save
  autocmd!
  autocmd CursorHold,InsertLeave * silent! wall
augroup END

Is there a known workaround or is it possible to fix this somehow?

Btw: the same issue exists in vim-yankstack, which I currently use as my daily driver. I've just tested miniyank to see if it has the problem too.

0xC0FFEE avatar Jul 28 '18 19:07 0xC0FFEE

One option is to increase 'updatetime', it can give a X seconds window before saving you can cycle (it should reset for each cycle).

There might be possible to write a command MiniYankPreserve that will preserve miniyank over wa and other commands that increase changed tick without actual change, I might look into it.

bfredl avatar Jul 28 '18 21:07 bfredl

Thank you for your swift response!

And you are absolutely right about the connection between updatetime, the CursorHold auto command and :wall.

Increasing updatetime seems like a good workaround for now; I'll give miniyank a try as my daily driver for a while.

Thanks again.

0xC0FFEE avatar Jul 29 '18 09:07 0xC0FFEE

Apparently you can decouple CursorHold time with updatetime using https://github.com/antoinemadec/FixCursorHold.nvim

ajitid avatar Feb 18 '22 10:02 ajitid