On Wednesday, July 23, 2014 7:54:36 AM UTC-5, Edward K. Ream wrote:
> Encouraged by the success of the simplified persistence project, I am
going to restart the vim-emulation project.
> All aspects of the design will be based on simplicity and accuracy.
I have now started the vim project. I immediately became immersed in the
code because I started to focus on the integration of vim emulation with
the rest of Leo. How vim mode handles plain keys is almost irrelevant at
this stage! What matters now are:
1. Getting the mode indicator correct. At present, it lags behind by one
key.
2. Having ":" in vim normal mode enter the minibuffer. At present, there
are all sorts of problems.
3. Displaying the cursor and selection area differently in normal, insert
and selection modes. At present, the cursor never changes. I'll emulate
vim's box cursor using a one-character selection range. Somehow Leo's core
will have to be aware of this "extra" selection.
4. Having <Return> in headlines switch to the body pane in normal mode.
Doesn't happen yet.
5. Handling all Alt and Control keys the same, regardless of vim mode. Not
sure what the present status is. Later, some exceptions will be made for
heavily used vim control keys.
The above 5 points will require changes to Leo's core. Happily, all such
changes will start with::
if c.vim_mode
or
if c.vim_mode and << predicate depending on vc.method >>
As a result, working on this project should be completely safe, because
c.vim_mode is True only if the user has set::
@bool vim_mode = True
Everything should work *exactly* as before as long as @bool vim_mode is
False.
So this is good. Getting these points exactly right right at the start is
a good strategy for the following reasons:
1. They are crucial to a good user experience.
2. They will make working on the vim commands much less confusing.
3. They will demonstrate that the vim code can be integrated seamlessly
into Leo's core, especially into the very complex code in leoKeys.py
(k.masterKeyHandler, k.masterCommandHandler and their allies).
4. They will strongly affect the design of helper methods within leoKeys.py
and corresponding methods within leoVim.py.
That's all for now. I expect to be spending at least a week on this part
of the vim project. It should be straightforward to add bells and whistles
to the actual vim commands when this preliminary work is done,
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/d/optout.