Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: settings #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: settings #40

wants to merge 2 commits into from

Conversation

jwkvam
Copy link
Owner

@jwkvam jwkvam commented Apr 9, 2018

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?
  • disable j/k moving between cells in vim command mode

@jlumpe
Copy link

jlumpe commented Dec 5, 2018

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.

@jwkvam
Copy link
Owner Author

jwkvam commented Dec 6, 2018

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.

@joshbode
Copy link

joshbode commented Dec 6, 2018

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

@jlumpe
Copy link

jlumpe commented Dec 6, 2018

@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 jlumpe mentioned this pull request Dec 6, 2018
@jlumpe
Copy link

jlumpe commented Feb 27, 2019

Any more progress on this?

@jwkvam
Copy link
Owner Author

jwkvam commented Apr 23, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants