Because honestly
:wq!
is just too much to type.
Please note that the question is about original Vi (say Vi which comes with FreeBSD) not Vim.
Because honestly
:wq!
is just too much to type.
Please note that the question is about original Vi (say Vi which comes with FreeBSD) not Vim.
If you're using gvim you can close it with
ALT+F4
. Two keys, but one keypress.If you're using vi in its own xterm,
ALT+F4
should close the xterm, killing vi as well.Does
:x
work on Vi? Although for your case I guess it might be:x!
What about "ZZ"? It has slightly different semantics to ":wq!", but is also slightly shorter.
What's wrong with the tried and true?
It's not one key press, but it's much less than :wq! which is what your question appears to truly seek.
Or is this a ViM only feature? My apologies if so.
Hold down the shift key and bang on Z twice.
ZZ
is (mostly) equivalent to:wq!
.If you really want a single-keystroke solution, FreeBSD comes with the source so, in a pinch, you could modify that and re-compile. It's a bit of an overkill but it'll solve your problem.
Map your favourite key to the :wq! command.
e.g. put this in your .vimrc:
Et voilá.
Edit: Sorry, vim only, missed that.