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.
You can't.
I noticed this question is about productivity, why on earth would you still be sitting in the console if you want productivity? :)
Ctrl-Z, kill %1
I know that's even more key presses, but but least you get out of vi quickly enough.
(warning: This will not save your document as :wq does. Take this as a kind of (bad) joke)
Use the key marked 'power' on the front of the computer. This, however, is likely to cause some disruption to productivity in most cases.
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.
What about "ZZ"? It has slightly different semantics to ":wq!", but is also slightly shorter.
This seems to work on solaris' old version of vi:
Version SVR4.0, Solaris 2.5.0
$ vi -c "map g ZZ" test
edit: Also, this seems to work:
$ vi -c 'map g :q!^M' test
Where ^M is actually, ^V (ctl-v) then ^M (ctl-m)
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.