Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nyngwang opened this issue Nov 29, 2022 · 5 comments

Comments

@nyngwang
Copy link

nyngwang commented Nov 29, 2022

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

@Eandrju
Copy link
Owner

Eandrju commented Dec 4, 2022

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.

@nyngwang
Copy link
Author

nyngwang commented Dec 4, 2022

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.)

@Eandrju
Copy link
Owner

Eandrju commented Dec 4, 2022

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.

@nyngwang
Copy link
Author

nyngwang commented Dec 4, 2022

@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.

@ragu-manjegowda
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants