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 spent several hours recently playing with vim and noticing subtleties about vim's screen and handling of the dot. I shall attempt the best possible emulation of vim, constrained by the following simplifying principles: 1. For now, and probably forever, the code will assume the typical vim key bindings. Not sure about vim key mapping, but that can wait. 2. The vim key bindings will apply only to plain keys (when @bool vim_mode = True). Leo's existing key bindings will still apply for non-plain (Alt, Ctrl, Meta) keys, even when vim_mode is True. However, it's possible that a few control keys will be handled differently in vim_mode in a hard-wired way... This "great divide" of keystrokes is the simplest thing that could possibly work. Furthermore, it allows the vim emulation to work in the much-more-complex Leonine environment *without* having to change any plain vim bindings! The trick is to use the Leo bindings for the Alt-Arrow keys and <return> to shift focus to and from the outline. <Return> never makes any sense when in the outline (in vim insert mode), so it may as well shift focus back to the body pane and enter normal mode. Slick. This "great divide" does have a few complications involving non-plain keys, especially Ctrl-G and Ctrl-R, but we'll muddle through somehow. The point is that vim is focused on plain keys, so getting them *exactly* right is the main problem. 3. I'll attempt as accurate an emulation as possible, including "Visual" and "Selection" modes, and especially attempting to recreate the cursor and selection areas exactly. I don't necessarily plan a *complete* emulation of every possible combination of plain keys. I'll start off with the most useful, and add others if and when anyone requests them. 4. Vim emulation will be based on a set of "official" commands whose names start with "vim_": vim_a, vim_dot, etc. These commands will update vim's dot as appropriate, and emulate the corresponding vim commands as closely as possible. 5. Vim's ':' key in normal mode will probably be a synonym for Alt-X. This seems reasonable because ":" commands do not affect the dot. That's all for now. Your comments and corrections are welcome. I expect to be able to use vim mode comfortably myself in just a few days. 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.
