jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
676 stars 43 forks source link

Is it possible to implement :wq ? #18

Open dtabell opened 3 years ago

dtabell commented 3 years ago

Before I forget (again) to say this, many thanks for this great plugin!

The commands :w and :q serve, respectively, to write the file and to exit to Jupyter command mode. Is it possible to to have :wq perform the combined action?

ianhi commented 3 years ago

I think this should be possible. You probably would need to add another mapCommand like is done here: https://github.com/axelfahy/jupyterlab-vim/blob/c4e43f940ef4be4c961608b6192412d2f3a33d1f/src/index.ts#L181

firai commented 12 months ago

Wouldn't mapCommand() create a normal mode key binding? It seems like ex commands are created with defineEx()? https://github.com/jupyterlab-contrib/jupyterlab-vim/blob/43ffc6e24f7cf279a3e32f9b5b170b5498cee220/src/index.ts#L127-L137.