Re: vi key bindings

You can just change the file amaya.kb and the shortcuts will change (and ther
is a help topic on how to do this that is more or less complete).

The question I have is whether there is a way to dynamically re-interpret
that file, so that you could have two different sets and swap between them
(for example in swapping from browse to edit mode - the equivalent of going
into and out of vi's insert/append mode).

(Personally i find Amaya indispensible for editing HTML - I see no reason to
actually type code, although I know it very well. Not having javascript is a
minor annoyance in the kind of work I do - having SVG and now animation makes
up for it in my case. And many many thanks to Irčne in particular who
(according to the CVS changes) implemented float).

my 2 cents worth

Chaals

On Thu, 24 Apr 2003, John Russell wrote:

>
>i have one question -- can you alter the shortcut key to action binding
>without recompiling Amaya.  that of course is important to the average
>user who just needs to tweak a few settings.
>
>and the idea of binding editor to viewer seems too much effort for little
>gain. in windows systems there are many editors that will call a browser
>of your choice  (or in the case of TextPad as many browsers or viewers
>as you have installed)....  this is not wysiwyg  but is good enough for
>testing purposes as a simple mouse press displays what you have.
>
>and wysiwyg editors are normally so steep in learning curve (amaya)
>or so restricted in potential (netscape composer)  that it makes more
>sense to learn the code (novel concept that)  and use your favorite
>pencil  (vi, emacs, textpad, notetab) ....
>i now use amaya only for its parsing error detection which is much better
>than validators (it does css and xhtml at one shot).  its display sucks
>so i check display in msie, netscape, and opera.   besides it doesn't even
>have javascript   and browser without javascript   is pizza without cheeze
>or more appropriately  television without color
>
>
>On 24 Apr 2003 at 5:19, Andrew wrote:
>
>Date forwarded: 	Thu, 24 Apr 2003 08:20:16 -0400 (EDT)
>Date sent:      	Thu, 24 Apr 2003 05:19:50 -0700
>From:           	Andrew <asha@onezero.org>
>To:             	Charles McCathieNevile <charles@w3.org>
>Copies to:      	www-amaya@w3.org
>Subject:        	Re: vi key bindings
>Forwarded by:   	www-amaya@w3.org
>
>[ Double-click this line for list subscription options ]
>
>
>Thanks Chaals.
>
>Based on a brief look at Amaya's help page for Thot keyboard shortcuts,
>it looks to me as though the infrastructure for Thot keyboard shortcuts
>is missing three facilities that are needed to have nice vi editing key
>bindings.  For that matter, this probably applies to other editors too,
>like emacs; substitute "emacs" for "vi" below if you like.  What seems
>to be needed is:
>
>  (1) the ability to store state, e.g., for the designer of the
>      keyboard shortcuts to create her own variables,
>
>  (2) the ability to evaluate condition expressions, and
>
>  (3) the ability to read state from the edit engine, e.g., what
>      line number we're on.
>
>With (1), we could, for example, store whether we're in vi insert mode
>or vi edit mode.  With (2) the behavior of a given key could depend on
>whether we're in insert mode.  With (3) we could implement things like
>"set a mark here" (to explain what this is to non-vi users: setting a
>mark is like placing a bookmark in a particular spot in the source).
>
>Without (1) - (3), the utility of having vi key bindings in Amaya is
>going to be pretty limited.  I don't need a really fancy set of vi key
>bindings, but I do want the basics, like having insert mode.
>
>Here are some more general considerations that I also wonder about.
>
>To get a nice way of editing web content using vi keys,
>which of the following is better:
>
>  (a) start with a vi clone and add browsing capabilities, or
>
>  (b) start with something like Amaya and attach vi key bindings to it?
>
>For (a) there's elvis, a vi-clone that can display html but not
>xml+css, mathml, or other things.
>
>Also for (a) there are possibilities like attaching a vi clone to a
>web browser so that the web browser periodically renders what's in the
>vi source editor.  Updates could be done, say, once a second, or once
>every 5 seconds.  This is probably much easier than (b).  The only
>drawback I can think of is that this might be awfully slow, eat lots
>of CPU time, and destroy the interactivity of the source editing.
>These things could be awful, or they could be no problem at all --
>one would have to see how it is in practice.  Other than that, I don't
>know any advantages to (b) over this method.  Having used Amaya only
>for browsing the Amaya help, it'd be nice to understand what some
>of the advantages of (b) might be.  Anyone?
>
>To implement (b) it's necessary that Amaya have capabilities like (1)
>- (3).  To get these capabilities, is it better to adapt the existing
>Amaya infrastructure directly, or is it better to get Amaya to allow
>the use of an extension language like Perl inside of files like what
>are now keyboard shortcuts?
>
>There's a third posibility:
>
>  (c) establish one or more protocols by which editors and renderers
>      communicate, and implement the protocol(s) in various editors
>      and renderers.
>
>With (c) one could hook up any editor that obeys the protocol to any
>renderer that obeys the protocol.  This would be much better than (a)
>or (b) in the long run.  It sure is painful to see all this work being
>repeated for every type of renderer that anyone designs, and for every
>type of editor that anyone designs.  With m editors and n renderers,
>method (c) requires only m+n work, instead of m*n work now (or, more
>realistically, what happens is that most of the m*n pairs don't get
>implemented).  The major drawback of (c) is that it's probably more work
>than either (a) or (b) for a single tool like Amaya, and it's not likely
>to provide the capability that I want any time soon, namely, to have the
>ability to browse and edit XML + CSS side by side, using vi key bindings.
>
>
>Andrew
>
>
>On Wed, Apr 23, 2003 at 10:12:29PM -0400, Charles McCathieNevile wrote:
>> here are some thoughts  which I have been pondering a few years too long:
>>
>> The browse and edit modes of Amaya suggest that you could replicate a lot of
>> the vi behaviour. Essentially you would need to apply one set of keyboard
>> shortcut modes in browse mode, and a different set in edit mode.
>>
>> There are also some things that would take a bit of real coding I suspect -
>> the power of vi is in the things that keystrokes can do, and Amaya doesn't
>> have all those functions as I understand it.
>>
>> There was a discussion on this list a while ago (I will look for a reference,
>> but I think it was around the tme of release 7) about having a different set
>> of shortcuts for different languages, when Irčne kindly gave some pointers
>> for where to make changes in the code to support this.
>>
>> cheers
>>
>> Chaals
>>
>> On Wed, 23 Apr 2003, Andrew wrote:
>>
>> >
>> >Is there a way to use the vi text editor key bindings in Amaya?
>> >
>> >If not, might this be added?  There would probably be a lot of interest in
>> >this.  For example comp.editors has lots of posts like, "Does anyone know of
>> >editors that let me edit XML using vi key bindings?"  Also, elvis, a vi
>> >clone, can display html side by side with the html source that's being
>> >edited, and this seems to be quite a popular feature of elvis, suggesting
>> >that there's a lot of interest in simultaneously editing and browsing
>> >editing html / xml / css - like stuff using vi key bindings.
>> >
>> >
>> >Andrew
>> >
>>
>> --
>> Charles McCathieNevile  http://www.w3.org/People/Charles  tel: +61 409 134
>> 136 SWAD-E http://www.w3.org/2001/sw/Europe         fax(france): +33 4 92 38
>> 78 22
>>  Post:   21 Mitchell street, FOOTSCRAY Vic 3011, Australia    or
>>  W3C, 2004 Route des Lucioles, 06902 Sophia Antipolis Cedex, France
>>
>--
>
>
>John Russell, VE3LL@RAC.CA
>http://home.cogeco.ca/~ve3ll (2 L's as in LLAMA)
>check HTML at http://www.htmlhelp.com/tools/validator/
>check CSS at http://jigsaw.w3.org/css-validator/
>check JavaScript at http://www.crockford.com/javascript/jslint.html
>
>
>

-- 
Charles McCathieNevile  http://www.w3.org/People/Charles  tel: +61 409 134 136
SWAD-E http://www.w3.org/2001/sw/Europe         fax(france): +33 4 92 38 78 22
 Post:   21 Mitchell street, FOOTSCRAY Vic 3011, Australia    or
 W3C, 2004 Route des Lucioles, 06902 Sophia Antipolis Cedex, France

Received on Thursday, 24 April 2003 21:06:31 UTC