echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.45k stars 171 forks source link

Animation for incremental search #945

Closed BitPusher16 closed 4 weeks ago

BitPusher16 commented 4 weeks ago

Contributing guidelines

Module(s)

mini.animate

Description

This lovely plugin has made my neovim work much more pleasant, thank you for that.

Is it possible to add animation support for cursor jumping during incremental search? This is the last jarring behavior which I've not been able to suppress in Neovim.

echasnovski commented 4 weeks ago

Thanks for the suggestion and kind words!

Unfortunately, incremental search is meant to be as quick as possible. Thus it does not seem to trigger any events which 'mini.animate' can "hook" into (like CursorMoved currently used for animating cursor movement). See this comment for reference as well as the whole issue discussion. Thus I am afraid it is not really possible to do that right now. And if it is made possible, then CursorMoved would trigger right away making cursor animated.

Closing as "not possible at the moment and if made possible should work out of the box".

BitPusher16 commented 4 weeks ago

Thank you for the detailed reply!

Last night I found a separate plugin which does what I need it to and works well alongside mini.animate.

https://github.com/RRethy/vim-tranquille

This plugin provides an alternative search function which can override the '/' default. It manually handles highlighting and calls the nvim search() function internally, without jumping. After a word is highlighted, mini.animate can nicely jump to the next instance on 'n'. My nvim is now free of jarring transitions!