Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!pasteur!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.editors Subject: Re: One user's editor wish list Message-ID: <11200@dog.ee.lbl.gov> Date: 20 Mar 91 21:30:06 GMT References: <1991Feb22.134323.20410@scrumpy@.bnr.ca> <11032@dog.ee.lbl.gov> <1991Mar20.191434.5634@scrumpy@.bnr.ca> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 91 X-Local-Date: Wed, 20 Mar 91 13:30:06 PST In article <1991Mar20.191434.5634@scrumpy@.bnr.ca> bnrmtl!lewis@larry.mcrcim.mcgill.edu writes: [`non printing characters'] >What I mean is being able to add/remove them from file. Of course they have >to be made visible somehow. The way vi does this is fine (except for tabs >cause I don't see them - but maybe this can be changed); with emacs I don't >know what it looks like, but I'm sure it's fine too. I will not attempt to guess how different Emacsen handle tabs (my own private version makes them `tab to column-mod-n' where n can be set on a per file basis; if you set n to zero or negative, tabs are just another control character). Vi has something called `list' mode in which tabs are shown as ^I: :set list turns this on, and :set nolist turns it off. In list mode end-of-line is also signified as `$'. [rings] >This is an XEDIT concept, it means simply +--> file A ---> file B ---+ >that the files are organized in a ring: | | >(and a single keystroke typically +--- file C <--- file D <--+ >moves you from one file to the next) Ah: in Emacs you just bring up ten zillion windows and select amongst them any way you like. In vi, `:n' (or :next) goes to the next file. There is no convenient way to back up (control-^ or :e# switches to the `current alternate file', which is the previous file after a :n, but you cannot get any further back than that). When you reach the end, or want to restart, `:rew' (:rewind) takes you back to the first. At any time, :args will show the arguments with [] around the current file. >>> Should be able to name multiple files on command line, e.g. ed *.c. >> Everything does this. >Well not on MS-DOS unless I'm really out of it. I guess I should have said `Every sane Unix editor'---VMS EDT apparently also does not. >[why does mail start one editor per file] This is the fault of whoever wrote mail; >(well, true, it would have to create many temporary files)? this is a likely reason. >> Vi allows piping through external programs to [fill lines] > >That's fine, but what if I only want to reflow a single paragraph, not the >whole file. You type {!}fmt and hit return: { means `move back a paragraph' (i.e., to the beginning of this one), ! means `filter' (pipe), } means `move forward a paragraph', and fmt is the `external program' that does it. If you like, map #1 {!}fmt^M in a .exrc or EXINIT will bind `function key 1' (if it exists, and is described in termcap) to this. One problem with this, again, is vi's limited understanding of `paragraph' (trailing whitespace on a blank line means that line does not separate paragraphs). One thing missing from some non-Unix editors is `tags': vi and Emacsen generally have the notion of a `tags file', which contains the names and `locators' for things in a program. Typing `:tag foo' means `find the tag for foo', and ^] means `find the tag for the word under the cursor' (in vi; Emacs tags generally are somewhat different). Tags are mainly useful for navigating around large programs. Tags locators are regular expressions, rather than line numbers, so that most changes to the source do not outdate them. Many vi tags implementations have an annoying bug: selecting a tag that appears in the current file fails if you have `nowrapscan' set and the tag appears before the current cursor position. This is easily fixed in the source: just save and restore nowrapscan, and turn it off for the tag search. -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov