You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What to observe:
Error message: cannot write a buffer without a filename
Workaround
In Vim, a similar keybinding is called ZQ, which triggers :quit!.
You can use ZQ in this situation.
Why ZZ doesn't work in Helix?
There is a difference in Helix's :x command comparing with Vim's.
In Vim:
:wq means save and quit, no matter the file has been modified or not.
:x (:xit) means if the file has been modified, save and quit, otherwise directly quit.
For an empty unnamed buffer, :x works without a filename, while :wq doesn't.
However in Helix:
:x is an alias to :wq.
Both save and quit, even with no changes or with external changes.
For an empty unnamed buffer, both don't work without a filename.
Proposed solutions
Make :x different from :wq.
Besides the benefit of being able to :x an empty unnamed buffer, the original behavior of :x is important when the file is changed from another application: You usually don't want to overwrite that change.
The text was updated successfully, but these errors were encountered:
I'd like to take a crack at this, it's a small quality of life improvement that I believe will also help my understanding of learning Rust in the perspective of a grand project
Related issue:
About mapping
ZZ
to:x
: #2041 (comment)Steps to reproduce:
ZZ
to quit.What to expect:
Helix should exit.
What to observe:
Error message: cannot write a buffer without a filename
Workaround
In Vim, a similar keybinding is called
ZQ
, which triggers:quit!
.You can use
ZQ
in this situation.Why ZZ doesn't work in Helix?
There is a difference in Helix's
:x
command comparing with Vim's.In Vim:
:wq
means save and quit, no matter the file has been modified or not.:x
(:xit
) means if the file has been modified, save and quit, otherwise directly quit.:x
works without a filename, while:wq
doesn't.However in Helix:
:x
is an alias to:wq
.Proposed solutions
Make
:x
different from:wq
.Besides the benefit of being able to
:x
an empty unnamed buffer, the original behavior of:x
is important when the file is changed from another application: You usually don't want to overwrite that change.The text was updated successfully, but these errors were encountered: