Adding 'ZZ' to .pyvimrc
mbusch-regis opened this issue · 3 comments
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!
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.
@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.
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).