home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15810 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  3.1 KB

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