I can't help but buy into this discussion:

> In command mode:
> 'D' also deletes to the end of the current line, saving a whole keypress

> 'ZZ' to save and exit instead of :wq... you don't need to move your fingers
> between keys :) 

Here's what someone had to say in the memorable vi vs Emacs Slug debate:
################
About the only choices vi DOES gives you is 35 different ways
to exit with saving and 25 different ways to accidentally delete stuff.
If you want to perform an operation on a region you're expected to
find the top line number of the region, find the bottom line number of
the region and then run an ex command on it. For a long time vi only
undid the last operation until the vi clones dragged it kicking and
screaming into the 17th century.  

now these guys think that emacs is bloated and inefficient and
non-elegant and doesn't follow the Unix 'keep it simple' philosophy
and pollutes the file system with mysterious files ending in the tilde
character. Sure, vi has got a faster startup time but it's also got a
faster shutdown time because you just can't wait to get out of
it. Make your change as quickly as possible, type shift ZZ or any of
the other 34 ways to exit vi while silently saving your mistakes, and
go back to the shell which by comparison to vi has a dream user
interface, especially with set -o emacs in effect. And who invented
tab completion anyway?? 
################
(vim has now caught up on regions with their 'visual mode' as Matthew
Dalton pointed out, so the 'ex' comment above is no longer valid... every
so often there is a vim improvement that adds a necessary feature
that's been in Emacs since year . )

It's never just 'one' key in vi; it's always ESC D and ESC ZZ;
you have to think "I want to do something besides type; I'd better hit
that pesky Escape key again". Then you make your editing change and
you have to think "time to start typing again; let's hit i,o,O,A"

Whereas in a modeless editor like Emacs you can instantly hit
C-k for delete to end of line (one keystroke; no change-of-mode required)
and C-x C-s to save your file or C-x C-c to exit the editor; two keystrokes
but you can keep your finger on the control key in the middle of the sequence.

Use vi for editing config text files and things by all means; but my
answer to the subject line of this thread: "Advice on coding in VI?" is
"Don't".

Stuart.

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to