cellular-automaton.nvim icon indicating copy to clipboard operation
cellular-automaton.nvim copied to clipboard

Could you provide a config option for customizing how to quit the animation?

Open nyngwang opened this issue 3 years ago • 5 comments

As title. That is: one can customize the key(s) (not Esc, q, <CR>) to quit the animation.

nyngwang avatar Nov 29 '22 09:11 nyngwang

It's an easy change, but to be honest I don't see much value in it. Why would you like to exit the animation with different keys?

FYI after last commit you can safely exit animation with :q or ZZ.

Eandrju avatar Dec 04 '22 14:12 Eandrju

I think my title is bad. Let me rephrase it. How about making "any key" the key to exit the animation? That is: use a one-time CursorMoved event to quit the animation. So I'm not saying that the current implementation is bad (For the current one, I was thinking about typing a password to cancel the animation), but I think it will be useful and fun to have a "press any key to exit" toggle to this plugin. (With this CursorMoved method, it will work more like a screen saver.)

nyngwang avatar Dec 04 '22 19:12 nyngwang

Yea, any-key makes sense and I actually wanted to do that in the first place, but I didn't know how. Subscribing to cursorMoved event seems like a good idea. I'll add it later.

Eandrju avatar Dec 04 '22 21:12 Eandrju

@Eandrju Thank you! You might checkout this project: https://github.com/itchyny/screensaver.vim, which seems to implement the any-key-cancellation for its animation. But since I haven't read about its code, it might not be useful.

nyngwang avatar Dec 04 '22 23:12 nyngwang

I would also love to have direct call to start and end animation, so that it lets us to customize extensively.

For example, I can have a keymap with custom function that lets me prepare animation (disable cursor column, indent line and what not) before starting animation.

I can have also have a function to start animation and stop or even exit vim after sometime.

Having blocking call at the end of start animation function is something I do not vote for.

ragu-manjegowda avatar Feb 01 '23 23:02 ragu-manjegowda