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

How do I export and import keyboard shortcut ?? #4628

Open
eromoe opened this issue May 14, 2019 · 1 comment
Open

How do I export and import keyboard shortcut ?? #4628

eromoe opened this issue May 14, 2019 · 1 comment

Comments

@eromoe
Copy link

eromoe commented May 14, 2019

I don't see there is an entry for export and import .

Because I am using jupyter spark docker image now , usually need start a fresh new container . It is really really very inconvenient to set keyboard shortcut every time .

I found https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Custom%20Keyboard%20Shortcuts.html .
But how can I set shortcut in a config file so that I can build a docker image which have the setting by default ?

I have checked all notebook.json files on my PC, none of them contained shortcut settings .

Found unstable method : https://jupyter-notebook.readthedocs.io/en/stable/extending/keymaps.html

There is also a method about modifying custom.js in https://stackoverflow.com/a/32159304/1637673 , but the syntax seems different with current one.

@simonwongwong
Copy link

I'm able to copy over keyboard shortcuts by copying the file ~/.jupyter/nbconfig/notebook.json between machines. You'll have to re-open your notebook to apply the shortcuts.

If you can't find your notebook.json, you should be able to create one. For reference, mine looks like this:

{
  "keys": {
    "command": {
      "bind": {
        "d,c": "jupyter-notebook:clear-cell-output",
        "d,r": "jupyter-notebook:restart-kernel-and-run-all-cells",
        "d,l": "jupyter-notebook:run-all-cells",
        "d,t": "jupyter-notebook:restart-kernel"
      }
    }
  }
}

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

No branches or pull requests

2 participants