home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.mac.misc:16508 comp.sys.mac.wanted:8402 comp.sys.mac.programmer:15449 comp.editors:2222
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!usc!hacgate!lyra!root
- From: root@lyra.scg.hac.com (Dave Fisher)
- Newsgroups: comp.sys.mac.misc,comp.sys.mac.wanted,comp.sys.mac.programmer,comp.editors
- Subject: Re: good vi editor for the mac
- Message-ID: <23284@hacgate.SCG.HAC.COM>
- Date: 14 Sep 92 16:46:39 GMT
- 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>
- Sender: news@hacgate.SCG.HAC.COM
- Reply-To: root@lyra.hac.com (Dave Fisher)
- Organization: Hughes Aircraft Co., El Segundo, CA
- Lines: 51
-
- In article <65734@cup.portal.com> ts@cup.portal.com (Tim W Smith) writes:
- ]> Keyboard macros
- ]> Toggle words
- ]> Execute other program
- ]> Towers of Hanoi (OK, OK)
- ]
- ]If you people could learn to write good code on the first try, you wouldn't
- ]need all those features. A fancy editor is a sign of a weak programmer.
-
- Oh, that's just silly. There are plenty of good uses for a powerful editor
- such as vi or emacs. And not all of them even relate to programming.
-
- Let me illustrate a couple of vi examples for the benefit of the non-Unix
- literate:
-
- 1. I'm editing a file on machine X. I need a line of text from another
- file on machine Y. I type "rsh machine-y grep keyword filename", then
- hit the q key, which is mapped to a sequence (!!sh) which will then run this
- line of text as a command, then return the output INTO my file. Presto,
- this other line of text is now in my file. My fingers never leave the
- keyboard.
-
- 2. Someone gives me a file which contains a list of 1000 birdnames, as well
- as a bunch of text paragraphs. I wish to replace each line which
- contains a birdname with a one line description of the bird, which I have
- in another file. I use range-based substitution to change each line to:
-
- grep birdname birdfile
-
- Then I type "!}sh" at the top of this "paragraph". Each line will now
- be replaced by the corresponding description.
-
- 3. I wish to sort from line 500 to line 1000, using the 3rd word in each
- line as the sorting key. I type 500G!500+sort +3. Done.
-
- The point is, vi (or emacs) are very powerful to a large degree because
- they can be *extended* with other programs (Emacs can be extended directly).
- This is a bit like the "plug-in software module" concept which we will
- hopefully be seeing more of on the Mac soon.
-
- Vi is also quick to use, once learned well, because your hands don't have
- to continually leave the keyboard to visit a mouse or keypad (EDT users
- you know who you are). But it is painful to learn. I've found it to
- be well worth the investment.
-
- I will grant, BTW, that vi is much less powerful/useful in the absence of
- Unix. Speaking of which, here's my two cents on the original question:
- if you want a really good implementation of vi for the Mac, the only way
- I know of to get it is to get AUX.
-
- Dave Fisher fisher@lyra.hac.com
-