jupyterlab-vim icon indicating copy to clipboard operation
jupyterlab-vim copied to clipboard

WIP: settings

Open jwkvam opened this issue 6 years ago • 6 comments

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 vs ctrl-e/y
  • [ ] keybinds for everything?
  • [x] ~disable j/k moving between cells in vim command mode~

jwkvam avatar Apr 09 '18 19:04 jwkvam

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.

jlumpe avatar Dec 05 '18 04:12 jlumpe

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.

jwkvam avatar Dec 06 '18 02:12 jwkvam

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

joshbode avatar Dec 06 '18 02:12 joshbode

@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.

jlumpe avatar Dec 06 '18 03:12 jlumpe

Any more progress on this?

jlumpe avatar Feb 27 '19 22:02 jlumpe

@jlumpe Sorry for going missing, thank you for contributing! I'll try to give this some attention and get it merged in this week.

jwkvam avatar Apr 23 '19 08:04 jwkvam