home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!caen!uwm.edu!ogicse!hsdndev!news.cs.umb.edu!mzraly
- From: mzraly@ra.cs.umb.edu (Michael S. Zraly)
- Newsgroups: comp.editors
- Subject: Re: Why I love VI
- Message-ID: <1992Aug21.040413.28174@cs.umb.edu>
- Date: 21 Aug 92 04:04:13 GMT
- References: <1992Aug10.100142.2416@ccu.umanitoba.ca>
- Sender: news@cs.umb.edu (USENET News System)
- Organization: UMass/Boston Dept. of Math & CS
- Lines: 49
- Nntp-Posting-Host: ra.cs.umb.edu
-
- rahardj@ccu.umanitoba.ca (Budi Rahardjo) writes:
- >
- > [...]
- >
- > What an editor should be
- > Budi Rahardjo
- >
- > IMHO, justification should be part of a text editor. Sometimes
- >I'd like to write simple documents, like this text, with centered and
- >justified text. This would be usefull in README files, or documenta-
- >tion to programs. FrameMaker and Interleaf would be overkill for this
- >kind of job, don't you think ?
- >
- > I don't need fancy things, just two things; center and justify.
- >Am I asking too much ? :-) BTW, this text was typed with VDE on an MS-
- >DOS machine.
- >
- > The 'fmt' command would not generate a nice format like this :-)
- >and the ability to justify the text on the fly is essensial for me
- >(just a personal preference).
-
- Centering is easy in vi, just pipe text through a simple awk script,
- e.g.
-
- awk 'length>0 {for(x=(72-length)/2;x>0;--x)printf(" "); print}'
-
- map this if you need to use it frequently.
-
- If you must justify *AND* fill, pipe through nroff (and uniq, to
- remove extra blank lines). Use your favorite macro package. (One thing
- I don't like about TeX is its inability to generate ASCII output, but
- that's only a peripheral issue here).
-
- The beauty of vi (and emacs too) is that it lets you use the under-
- lying operating system to its full advantage, without having to incor-
- porate code for things like fmt, fill, sort, uniq, nroff, awk, etc. But
- it does require you to know how to take advantage of it: sometimes that
- means writing macros or mappings, sometimes shell scripts invoked by
- these macros. You pay for this flexibility by having to do a little
- preparatory work, but on the other hand if you don't like the way that
- a particular mapping works, its not difficult to make improvements.
-
- All IMHO, of course.
-
- -- Mike
-
- --
- Mike Zraly An effective way to deal with predators
- mzraly@cs.umb.edu is to taste terrible.
-