Aha 1: box cursors are easy.
There is no need to change the Qt cursor. The vim commands will simply
extend the selection range by one character. Doh! This is unlikely to
lead to substantial complications.
Aha 2: It *is* possible to use the vim keystrokes almost unchanged in Leo(!)
We certainly need to *extend* the key bindings, but we probably won't need
to *change* any of them.
The prime candidate for extension is the 'g' command. It has (at least)
the following variants:
g0,gD,gE,gI,gU,ga,gd,ge,gf,gg,gj,gk,gq,gs,gu,gv
There may be others not mentioned in the summary I consulted, but surely
there are characters that can be commandeered without disturbing anyone.
Let's pick x.
The present scanning mechanism is (or is about to be) flexible enough to
handle new commands like this:
gxt goto tree pane
gxb goto body pane
gxl goto log pane
etc.
The z and Z commands also could be extended easily from a "syntax" point of
view, but the meanings of the z and Z commands aren't prime candidates for
extension. Similarly for the [ and ] and < and > commands. But we *could*
extend any of these commands in a pinch. And actually, the z (redraw)
command might have useful extensions.
The point is the the g,z,Z,[,],<, and > commands *already require* a second
character, so we can extend them with new second characters.
In contrast, commands like h,j,k,l etc can *not* be extended, because they
are always and only one-character commands. There would be no easy way to
tell the scanner that an extension was coming.
Hmm. As I write this I see that *if* there we an unused character to be
used instead of a repeat count, we could use this to signal an extension.
Alas, I think *all* the keys are used!
'+' key is used. But just as a thought experiment, suppose it weren't.
Then we could extend *any* single-character command, say a, with syntax
like::
+ag
+25ag
In short, simple syntax extensions will provide the "escapes" needed to
extend the vim commands for use in Leo. This is a big change in point of
view.
Naturally, some vim commands will have to take into account what pane has
focus, but this was always going to be needed.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.