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

Adding 'ZZ' to .pyvimrc #122

Open
mbusch-regis opened this issue Feb 7, 2019 · 3 comments
Open

Adding 'ZZ' to .pyvimrc #122

mbusch-regis opened this issue Feb 7, 2019 · 3 comments

Comments

@mbusch-regis
Copy link

I seem to be odd that my primary method for exiting vim is the 'ZZ' command -- I don't think I've talked to another vim user (f2f). Of course I want that method of exiting pyvim but I've been frustrated in all my attempts to add it to .pyvimrc.

My closest attempt so far will exit but it does not write the file:

     @editor.add_key_binding('Z', 'Z', filter=ViNavigationMode())
     def _(event): 
         """
         Typing '<shift>zz' in navigation mode should write the buffer and quit.

         (imap ZZ :wq)
         """
         editor_buffer = editor.current_editor_buffer
         write_and_quit(editor,editor_buffer.location)

Any suggestions how I can make it both write and quit?

Thanks!

@hurdlecrew
Copy link

You are not alone. I recently started using pyvim on my Android laptop when working in pydroid, and zz is definitely a feature I miss.

@jonathanslenders
Copy link
Member

@mbusch-regis , @hurdlecrew : Is any of you able to test the pull request from @lieryan above?
If it works for you I will merge it. I have not had the time yet to extensively review/test it.

@mbusch-regis
Copy link
Author

Initial, cursory tests of the ZZ key binding are good. Will try to test others as time permits (but don't hold your breath... not a lot of time or attention to spare).

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