home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!kronos.arc.nasa.gov!butch!netcomsv!netcomsv!ulogic!hartman
- From: hartman@ulogic.UUCP (Richard M. Hartman)
- Newsgroups: comp.unix.questions
- Subject: Re: So what _is_ so good about vi?
- Message-ID: <904@ulogic.UUCP>
- Date: 21 Jan 93 15:06:20 GMT
- References: <1jcoq7INN5eg@zikzak.apana.org.au>
- Organization: negligable
- Lines: 59
-
- I guess I am in the minority. Even the vi-defenders tend to hedge
- and say it's commands are cryptic. Wordstar is cryptic. Emacs
- is cryptic (alt-meta-cokebottle does WHAT?). vi is cryptic if you
- try to learn a sequence as a whole, but each command breaks down
- into actions and domains. The most common ones are relatively
- mnemonic. Some of the difficult parts come from the ancient
- days when terminals didn't even necessarily have arrow keys.
- the "hjkl" for movement (left,down,up,right) respectively makes
- a nice sort of "embedded arrow pad". Other movements are mnemonic:
- w for word, c for character, e for end of word. d for delete
- followed by w for word, and voila: delete word!
-
- Now I have stuck to some of the simpler stuff here, ^ for start
- of line and $ for end of line may not be the most obvious choices,
- and the bookmarking, cut&paste registers and the more advanced
- features take a bit of getting used to, but they are very quick
- once you have them down. The trick is to remember that every
- command is built up of smaller, relatively easy to learn, pieces.
-
- Move one paragraph below the next? d}}P I don't
- even think about it, because it isn't one command.
-
- d - delete
- (delete what?)
- } - move to next empty line (it's symbolic, not mnemonic -- so sue me!)
- (ok, it's gone)
- } - move to next empty line
- (we're positioned after the next paragraph)
- P - paste what we deleted above us
- (voila!)
-
- Each piece is relatively simple. Eventually your fingers start doing
- things all by themselves. How would emacs do that? you would
- probably have to set a begin mark and an end mark then cut then
- move then paste. But an emacs-person can post the escape sequences
- that would be required if they really want to.
-
- The only similar editor I know of is VMS's EDT in "nokeypad mode".
- I had a VT-52 terminal emulator that didn't emulate the keypad,
- even when I FOUND a keypad terminal I preferred nokeypad mode,
- who can remember that keypad-3 is CUT (or whatever), but a
- simple CUTSEL is "CUT SELected text". Again, everything built
- up out of smaller parts.
-
- Most menuing editors I've seen are two simple to be very useful.
- EMACS has always confused me much more than vi. I have to admit
- that my favorite editor is BRIEF, on DOS, and I think that it may
- be an EMACS-derivative, but I think they've tamed it a lot.
-
- Then to recap what some of the others have already said: vi can be
- found on almost every unix system in existance, the same can not be
- said of EMACS. Your fingers never have to leave the main keys to
- use the vi commands.
-
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Oh I give my life so lightly |
- to my gentle lady. | -Richard Hartman
- Giving freely, and completely, | hartman@uLogic.COM
- for my lady. |
-