jupyterlab-vim
jupyterlab-vim copied to clipboard
WIP: settings
This is very much unfinished and broken. I'm putting this here in case any one wants to take this and try to flesh this out. Jotting down some things as options:
- [ ] single vs double keys for certain actions like
ctrl-o, d, d
for cut vs.ctrl-o, d
. - [ ] keybinds for moving cells: some users might like
alt-j/k
vsctrl-e/y
- [ ] keybinds for everything?
- [x] ~disable j/k moving between cells in vim command mode~
How is this going? I have a multi-user jupyter installation that I currently can't install this on because I can't enable it on a per-user basis. I'm happy to help out if needed.
Hi @jlumpe! Sorry about that. I haven't worked on this in a while. I don't think I'll get back to this soon either :( I'm not even sure this stuff I'm working on would solve your problem. I don't use a multi-user setup myself.
All that being said, if you want to tackle this, you are more than welcome! If you have any questions, feel free to ask.
I'm not sure what your particular setup is, but I use the following method on a shared JupyterHub instance (based on https://zero-to-jupyterhub.readthedocs.io/) that I manage where I install jupyterlab-vim
into the docker image and immediately disable it:
Dockerfile
:
...
RUN \
jupyter labextension install \
jupyterlab_vim && \
jupyter lab build && \
jupyter labextension disable jupyterlab_vim
...
then in the Helm config.yaml
add support for postStart
hooks:
...
singleuser:
...
lifecycleHooks:
postStart:
exec:
command: ["/bin/bash", "-c", "
[[ -d $HOME/.config/jupyterhub/startup ]] && /bin/run-parts $HOME/.config/jupyterhub/startup;
exit 0;
"]
...
and finally in those accounts that want to use the extension (currently just me!) create an executable file ~/.config/jupyterhub/startup/jupyterlab_vim
with the contents:
#! /bin/sh
jupyter labextension enable jupyterlab_vim
@jwkvam I actually forked this branch and cleaned it up a bit to just have the "enable" setting. I added it to my shared Jupyter installation and it works great. I'll submit a PR for it.
As for actually solving the problem: I don't know if this is officially documented anywhere (see the PR) but you can override default extension settings for the whole installation by creating the file $JUPYTER_PATH/lab/settings/overrides.json
. I just added
{
"jupyterlab_vim:vim": {
"enable": false,
}
}
and it is disabled for all users by default. I can then override it in my personal settings using the standard interface.
Any more progress on this?
@jlumpe Sorry for going missing, thank you for contributing! I'll try to give this some attention and get it merged in this week.