home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / misc / 16508 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  3.0 KB

  1. Xref: sparky comp.sys.mac.misc:16508 comp.sys.mac.wanted:8402 comp.sys.mac.programmer:15449 comp.editors:2222
  2. Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!usc!hacgate!lyra!root
  3. From: root@lyra.scg.hac.com (Dave Fisher)
  4. Newsgroups: comp.sys.mac.misc,comp.sys.mac.wanted,comp.sys.mac.programmer,comp.editors
  5. Subject: Re: good vi editor for the mac
  6. Message-ID: <23284@hacgate.SCG.HAC.COM>
  7. Date: 14 Sep 92 16:46:39 GMT
  8. References: <lawton.715610572@armand> <1992Sep4.192444.24921@cucbs.chem.columbia.edu> <1992Sep5.221526.10841@uc.m sc.edu> <Bu94Kw.4Mz@csn.org> <D88-JWA.92Sep8123551@black.nada.kth.se> <65734@cup.portal.com>
  9. Sender: news@hacgate.SCG.HAC.COM
  10. Reply-To: root@lyra.hac.com (Dave Fisher)
  11. Organization: Hughes Aircraft Co., El Segundo, CA
  12. Lines: 51
  13.  
  14. In article <65734@cup.portal.com> ts@cup.portal.com (Tim W Smith) writes:
  15. ]> Keyboard macros
  16. ]> Toggle words
  17. ]> Execute other program
  18. ]> Towers of Hanoi (OK, OK)
  19. ]
  20. ]If you people could learn to write good code on the first try, you wouldn't
  21. ]need all those features.  A fancy editor is a sign of a weak programmer.
  22.  
  23. Oh, that's just silly.  There are plenty of good uses for a powerful editor
  24. such as vi or emacs.  And not all of them even relate to programming.
  25.  
  26. Let me illustrate a couple of vi examples for the benefit of the non-Unix 
  27. literate:
  28.  
  29. 1. I'm editing a file on machine X.  I need a line of text from another
  30.    file on machine Y.   I type "rsh machine-y grep keyword filename", then
  31.    hit the q key, which is mapped to a sequence (!!sh) which will then run this
  32.    line of text as a command, then return the output INTO my file.  Presto,
  33.    this other line of text is now in my file.  My fingers never leave the
  34.    keyboard.
  35.  
  36. 2. Someone gives me a file which contains a list of 1000 birdnames, as well
  37.    as a bunch of text paragraphs.  I wish to replace each line which
  38.    contains a birdname with a one line description of the bird, which I have
  39.    in another file.  I use range-based substitution to change each line to:
  40.  
  41.    grep birdname birdfile
  42.  
  43.    Then I type "!}sh" at the top of this "paragraph".  Each line will now
  44.    be replaced by the corresponding description.
  45.  
  46. 3. I wish to sort from line 500 to line 1000, using the 3rd word in each
  47.    line as the sorting key.  I type 500G!500+sort +3.  Done.
  48.  
  49. The point is, vi (or emacs) are very powerful to a large degree because
  50. they can be *extended* with other programs (Emacs can be extended directly).
  51. This is a bit like the "plug-in software module" concept which we will
  52. hopefully be seeing more of on the Mac soon.
  53.  
  54. Vi is also quick to use, once learned well, because your hands don't have
  55. to continually leave the keyboard to visit a mouse or keypad (EDT users
  56. you know who you are).  But it is painful to learn.  I've found it to
  57. be well worth the investment.
  58.  
  59. I will grant, BTW, that vi is much less powerful/useful in the absence of
  60. Unix.  Speaking of which, here's my two cents on the original question:
  61. if you want a really good implementation of vi for the Mac, the only way 
  62. I know of to get it is to get AUX.
  63.  
  64. Dave Fisher fisher@lyra.hac.com  
  65.