jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
660 stars 43 forks source link

Visually indicate which text was yanked #117

Closed joelostblom closed 9 months ago

joelostblom commented 9 months ago

Is it possible to visually indicate yanked regions with a highlight? I would like the same functionality as Neovim provides via this setting, or vim-highlightedyank provides for base Vim. I find this useful for confirming the yanked region (especially when grabbing a paragraph or targeting a character where it is easy to overlook that there is another of the same character earlier or grab an extra whitespace)

I tried hacking it with a rebind like map Y v$y and hoped the visual selection would flicker before it was yanked, but the yank happens instantaneously so the visual selection is not shown. It seems that codemirror's vim does no include the gs command or :sleep which otherwise could have been incorporated in a shortcut, so I think this might have to happen in the core extension.

Here is a short demo of what this could look like:

ianhi commented 9 months ago

This would need to be fixed upstream, there seems to be a feature request there: https://github.com/replit/codemirror-vim/issues/121

joelostblom commented 9 months ago

Thanks for linking that issue. I followed up with a comment there and I'm closing this one.