Closed SamLau95 closed 1 year ago
It's possible to add the ability to render Markdown on Ctrl+Enter when the plugin is active, but it's currently not possible to stay in vim (Normal) mode when that happens. This is because rendering Markdown essentially turns the cell into output, and the plugin is currently not able to navigate output via vim (see #53 and #56). You can see this in action if the first cell is a Markdown cell and if you press k there (#52). Therefore, if we implement this, Ctrl+Enter in a Markdown cell would render the Markdown and then have to eject the user to Jupyter Command mode.
By the way, you may already be aware of this, but navigating up or down away from a Markdown cell in this plugin auto-renders the cell.
@firai Thanks for the context. I mixed up the terminology in my original question – I'd like it if Ctrl+Enter
in a Markdown cell would render Markdown and eject the user to Jupyter Command mode, as you said. From what I know, this is the default behavior of Ctrl+Enter
in Jupyter Lab and Notebook.
Contributions would be welcome. Looking at the key bindings, Ctrl+Enter is redirected to the vim:run-cell-and-edit
command, which is defined here:
I think what's needed here is to fire the notebook:run-cell
command, which is JL's default command for this binding, if the cell is a Markdown cell. You should be able to test if the current cell is a Markdown cell by following this pattern:
Thanks for working on jupyterlab-vim! I'm using it to do live-coding for my lectures at UC San Diego.
My muscle memory for using ctrl-enter to render Markdown cells is quite strong. Is there a way to re-enable that command when the extension is active?
When I'm editing a Markdown cell (in vim normal or insert mode), I'd like the ability to press ctrl-enter to render the cell and return to Jupyter vim mode.