From: petcher@ds10.scri.fsu.edu (Don Petcher)
Newsgroups: comp.editors
Subject: Editor Keys (was Re: me vs. vi survey *please read*)
Date: 10 Apr 92 04:11:28 GMT
Reply-To: petcher@wuphys.wustl.edu(Donald N. Petcher)
Organization: Physics Dept, Washington U. in St Louis

In article <1992Mar31.071338.25314@cunixf.cc.columbia.edu> lasner@watsun.cc.columbia.edu (Charles Lasner) writes:
>A side issue surrounding this whole thread:
>
>There has been far too many programs written with unreasonable dependence on
>"extra" keys.  Editors are a large sub-class, but it seems that too many
>people believe that the only keys that can "function" are f-keys, etc.
>
>Some of the thread seems to hinge on whether personal preference of which
>"user interface" to the features of the editor is more important than the
>actual underlying features themselves.
>
>In some editors, the available keys are merely "serving suggestions" (to borrow
>that dumb phrase on food packages) and not be-all/end-all in and of themselves.
>Someone even raised the issue that he wants the default bindings merely 
>because it isn't always easy or convenient to change, even though it's a
>standard feature of the editor to do so.  Is this a favorite editor survey, or
>a survey of the editor most likely to be griped about, yet still put up with?
>
[More deleted]

I do agree with this, but in adopting precisely this philosophy in the
port of an editor from the Atari ST world (in that environment it makes
use of ctrl, alt, function keys in an efficient intuitive way) to Unix,
I am struggling with exactly how one should implement the philosophy. 
Alt, function and many control keys are of course not available.

In contrast to vi (switch between insert and command modes), and emacs
(commands largely through meta key control sequences), this editor works
with a command line (more like TPU on the VAX: here you enter the
command line with Esc). Although all commands are available through the
command line, one would like to put most often needed commands on the
keyboard when possible. My basic philosophy is this:

1. Use only 'standard' keys (available on the most basic terminals, within 
   reason. This includes control combinations of some keys). No alt key, 
   keypad, etc. If available, the latter could be used for key redefinitions 
   of course.

2. Avoid arbitrary assignments to keys that can give rise to conflicts, or
   should have standard uses.

3. Assign most often used editing commands to control keys.

4. Assign next most used commands (save, quit, readfile, switching buffers, some
   editing commands) to simple 2 stroke meta key combinations. I probably need
   at least 2 control keys as meta keys (a little ugly, but I dislike 
   multiple levels of menus even more - could perhaps be persuaded though if 
   the arguments are good).

5. The command line 'edit language' should be efficient ('Unixy' - NOT like
   TPU), so that many commands will be just as quick through the command line
   (e.g. <esc> p <return> for paste command - i.e. only 3 keystrokes).


The problems are many of course, as everyone who has thought about this
will realize, but I want to decide on a reasonable layout from the
outset, since as has been emphasized here, even though one can redefine
the key layout (yes, it is allowed by the editor), most people don't. So
questions:

- Where does one find a list of available keys within some accaptable
standard? For example, on some keyboards the ctrl key works with punctuation
(e.g. ctrl-? is meaningful) whereas on others it is no different from ?. Is
there an ANSI standard set of keys one should limit oneself to? Here I would
assume to include cursor keys in the standard and not use the 'most valued'
(i.e. some control keys) keys to reproduce thier effect. If one has to work
on a terminal without cursor keys regularly in this day and age, I think it
reasonable to assume that to be the exception. Then one would just have to 
redefine keys as one likes.

- With regard to 2 above, what keys should be avoided? ctrl-S, ctrl-Q
for example? Apparently some systems intercept these, although I have
not worked on any that do. Ctrl-Z should certainly have its usual
meaning under Unix. What others?

- Are there 'must have' conventions to adopt for some control keys? For
example, I have seen people here advocating ctrl-X,C,V as cut copy paste
(why?), although I would think that perhaps one better make these three
actions a little harder to perform in favor of some more basic editing
functions. I would also not think this applies to ctrl-X as a meta key
for example, just because one famous editor uses it (actually several in
the PC world do, probably all based on emacs). I use it for delete word
presently. There may be some conventions I am unaware of, about which I
would like to know.

Any other comments would be appreciated. However, a word of caution is
perhaps advised. Those who don't agree with my philosophy, or just like the
way vi or emacs does it and don't see why I should bother with another editor
(it DOES have its own unique features not mentioned in this post ... :-),
could easily start more editor wars. I am really only looking for practical
help with a practical problem and would not like to see more wars. I
think there is plenty of room in the Unix world for a TPU like (command line
driven) editor for 'the rest of us'.

Cheers,
Donald Petcher                            petcher@wuphys.wustl.edu
Department of Physics
Washington University
St. Louis, MO 63130