marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Multi-mode Vim support like Jupyterlab-Vim

Open anjiro opened this issue 1 year ago • 1 comments

Description

Jupyterlab-Vim adds a "Jupyterlab Command Mode" which enables manipulation at the cell level. It's super nice and I'd love to see it implemented in Marimo.

Suggested solution

Here's what Jupyterlab-Vim lists (copied verbatim):


Please note that all keys are lowercase unless Shift is explicitly indicated. For example, Y, Y is two lowercase ys, Shift-Y, Y is one uppercase Y followed by a lowercase y.

Shortcuts this extension introduces:

Vim Ex commands

Command Action
:w[rite] Save Notebook
:q[uit] Enter Jupyter command mode

Vim command bindings

Chord Action
Ctrl-O, U Undo Cell Action
- Split Cell at Cursor
Ctrl-O, - Split Cell at Cursor
Ctrl-O, D Cut Cell
Ctrl-O, Y Copy Cell
Ctrl-O, P Paste Cell
Ctrl-Shift-J Extend Marked Cells Below
Ctrl-Shift-K Extend Marked Cells Above
Ctrl-O, O Insert Cell Below
Ctrl-O, Ctrl-O Insert Cell Above
Ctrl-J Select Cell Below
Ctrl-K Select Cell Above
Ctrl-O, G Select First Cell
Ctrl-O, Ctrl-G Select Last Cell
Ctrl-E Move Cell Down
Ctrl-Y Move Cell Up
Ctrl-O, Z, Z Center Cell
Ctrl-G Show Tooltip
Command/Ctrl-1 Code Cell Mode
Command/Ctrl-2 Markdown Cell Mode
Command/Ctrl-3 Raw Cell Mode
Shift-Escape Leave Vim Mode
Escape, Ctrl-[ Exit Vim Insert Mode

Jupyter command bindings

Chord Action
G, G Select First Cell
Shift-G Select Last Cell
D, D Delete Cell
Y, Y Yank (Copy) Cell
P Paste Cell
Shift-P Paste Cell Above
O Insert Cell
Shift-O Insert Cell Above
U Undo Cell Action
Ctrl-E Move Cells Down
Ctrl-Y Move Cells Up
Z, Z Center Cell
Z, C Hide Code Cell
Z, O Show Code Cell
Z, M Hide All Code Cells
Z, R Show All Code Cells

Alternative

No response

Additional context

No response

anjiro avatar Mar 11 '24 11:03 anjiro

Thanks for the feature request! I've used these bindings in the past, and they are nice.

Unfortunately we likely won't get to this soon, just because of a backlog of other tasks ahead of us. But I will keep this open for the future, and so that others can :+1: it if they'd also like to see these bindings implemented.

akshayka avatar Mar 11 '24 21:03 akshayka