I've been playing around with vim and thinking about it.
Minibuffer abbreviations may be useful, and were certainly a useful thought
experiment for vim, but it won't suffice for vim. Here is the way forward:
1. Leo will have a true vim (or vim-like mode), enabled with something
like::
@bool vim-mode = True
Imo, there is no real need for more faux generality. This switch expresses
the true intent of the code perfectly.
2. In vim mode, everything that gets typed (in normal mode) will go into
the minibuffer. This will provide important feedback.
3. There will be a new setting, say @data vim-commands. This will be a
list of simplified regular expressions, something like:
0: the actual number 0
1: an optional repeat count
2: a required repeat count
M: a set of motion commands
\M: the actual letter capital M
V: visual commands
\V: the actual letter capital V
etc.
Examples:
0
1E
VJ
1dM 2dd d2d, d$ etc
A preprocessor will translate these into a list (or maybe dict) of actual
regular expressions.
k.getArg will accept characters until one of the actual regexs match. This
imposes constraints on the regexs! The preprocessor might (or might not)
check those constraints.
When a regex matches, its components will be parsed, and the components
sent to the vim-like command given by the corresponding setting. Example:
gg vim-goto-first-line
One of the beauties of this scheme is that I can test it without changing
Leo's source code! This accelerates the project. I plan to do this today.
The "extra" step of parsing @data vim-commands is crucial. It provides the
flexibility needed to allow people to adapt vim's keystrokes to Leo's
environment. Each vim user may have a different notion of how to do this.
@data vim-commands will make this as easy as possible.
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.