Re: Simple Unix Text Editor
Posted in 1993
In <2dl6hfINNngc@emory.mathcs.emory.edu> alan@po.den.mmc.com (Alan Popiel) writes: >This reply is NOT intended to restart the one-true-editor holy wars!! Nor this, just some thoughts having seen many users use vi. Also, note I'm a true addict and fan of vi. >However, since you asked, I would recommend at least considering using vi. I recommend strongly against it, unless these folks are going to be pure Unix hacks. I'd recommend emacs to a new user any day over vi. I even more strongly recommend pico for most users. >Like most things, vi has both good and bad features relative to your >projected usage. I've had a lot of experience watching users use vi -- I do frequent seminars on Unix, C, etc., with labs, and watch even fairly experienced Unix users struggle with vi. It's NOT intuitive, not matter how mnemonic some of the keys are. It deserves much praise as one of the first full screen editors (though not THE first, by any means; I still recall the rand E editor with fondness), but it really needs to be augmented with a little brother, a standard casual users editor. (The X editors fill this need for those with X, but vi just doesn't cut it for text terminals.) >Advantages: >1. vi is available on virtually all Unix systems. Only because USL or any other Big Name hasn't taken the initiative and provided something better for novices. Pico gets my vote. >3. You can use an .exrc file to specify wordwrap. Wordwrap is relative to > the window size, which your program can specify, which in turn keeps your > users from using the wrong wrap margin. Some guru may know how to specify > wordwrap as an option to vi, thus eliminating the need for the .exrc file. vi "+:set wm=5" ... (wm=wrapmargin, how far from right margin to wrap) or put it in your $EXINIT. You can alleviate some stress to if your vi has "showmode"; setting that displays a little mode indicator on the bottom line, "A" for insert, etc. It still looks odd though, this seemingly random character sitting below your text. >4. For light editing, vi is "sort of" mnemonic: i for insert, a for append, etc. Uh huh, hjkl are really obvious. We all have ADM-3A terminals with the arrow keys printed on the keycaps these days. :-) And, most users expect arrow keys to work right in insert mode (at best one gets an arrow key in insert mode to do something like beep and exit insert mode; more likely it inserts garbage). My favorite is for arrow keys mapped as Esc-O-A: Exit insert mode, open new line, put "A" on it. >5. vi supports all your standard functions: search, replace, etc. Albeit in odd ways. :%s/foo/bar/g is really more difficult than it could be for novices. >Disadvantages: >1. While new input lines are word wrapped, insertions/deletions in existing > text do NOT result in the rest of the paragraph being rewrapped. So, you do "!}fmt" . Yeah, right, try teaching that to novices and expect them to remember or like it. >2. vi is a "moded" editor (insert vs. command), which some users find confusing. Most people find this annoying. I'm a touch typist, so I don't *like* control and escape commands, but I'm aware I'm in the minority here. Vi is not a user friendly editor, and Unix has suffered much bad reputation because of it and programs like it. (Note this makes me sad; I've been in love with Unix for over a dozen years, and really don't want to see it lose ground to something like N(o)T. If cleaning Unix utilities up makes it more palatable to the swarming masses, let's do it.) But let's not turn users off to Unix by pushing vi on them. Most users are technophobic enough. Re my earlier post in this thread: I'll post my 5-min-hack Informix editor as soon as I can get some minor cleanup done to it (get all the funcs into one file, etc.). I'm tied up tomorrow, but hopefully by Monday. -- Andrew Burt aburt@du.edu "But if he was dying he wouldn't bother to carve "Aaaaargh", he'd just say it."