This sketch shows my present thinking about how to better integrate Leo with external programs such as vim, emacs or even browsers:
The left side shows a separate program, say vim. The right side shows Leo, with the body pane hidden because vim becomes Leo's de-facto body.
In Leo: Pressing <return> in the outline transfers control to vim, showing c.p.b with the cursor in the proper place.
In Vim: `:leo` transfers control to Leo, updating c.p.b and putting focus in the outline.
Similarly, in emacs, <Alt-X>leo.
This would let Leonistas to use the real vim (or neovim, or emacs) for text editing.
Discussion
The diagram implies that both Leo and vim/whatever are usually handling keystrokes as usual. This ensures native speed in the external program.
To make this work, we (only) need some kind of client-server interaction, so that Leo and vim can activate each other without using Alt-Tab.
This will be the focus of my playful prototypes when I return from vacation. Using yoton is an option, because neovim supports python. A simpler client-server scheme might suffice. And would be necessary with emacs.
Your comments, please.
Edward
P. S. Relevant vim-related issues:
-
#990: Embed neovim into Leo.
-
#981: Editing in an external editor.
-
#559: vim-open-node positions cursor at the last line.
-
#313: vim-open-node opens file instead of a node.
EKR