Unbinding Keyboard Shortcut in jupyter notebook

138 views
Skip to first unread message

Lorenz Braun

unread,
Apr 3, 2017, 12:06:40 PM4/3/17
to Project Jupyter
Hello there,

i am using the jupyter notebook on my Mac with the German Neo 2 Layout. Unfortunately i can't type ':' because Cmd-d is bind to deleteLine.

I tried to remove the Shortcut by adding this to my notebook:
%%javascript

Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('cmd-d');
 
Which yields this error:
Javascript error adding output!
Error: trying to remove a non-existent shortcut
See your browser Javascript console for more details.
 
I guess i need to change Cmd-d to something else but i can't figure out what it needs to be.
I also tried:
ctrl-d
meta-d
alt-d

Does anyone know what to put in there?

Kind regards
Lorenz

Thomas Kluyver

unread,
Apr 3, 2017, 2:01:12 PM4/3/17
to Project Jupyter
Hi Lorenz,

Delete line is not something bound by our shortcut system - I guess that's defined by Codemirror, the editor component we use. That's going to require totally different code for removing a shortcut, unfortunately.

Thomas

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/93a543b5-ca71-436f-ab88-f3455ad09dc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lorenz Braun

unread,
Apr 3, 2017, 2:47:31 PM4/3/17
to Project Jupyter
Hi Thomas,

thanks for the quick answer. I was just wondering if i could not remove that shortcut, because iti s listed nowhere in the jupyter documentation. Seems that this is the case. That is really unfortunate =(

I worked around that problem by editing my keyboard layout so that : is bound to another key, which i don't need.

Lorenz


Am Montag, 3. April 2017 20:01:12 UTC+2 schrieb takowl:
Hi Lorenz,

Delete line is not something bound by our shortcut system - I guess that's defined by Codemirror, the editor component we use. That's going to require totally different code for removing a shortcut, unfortunately.

Thomas
On 3 April 2017 at 17:06, Lorenz Braun <lorenz....@gmail.com> wrote:
Hello there,

i am using the jupyter notebook on my Mac with the German Neo 2 Layout. Unfortunately i can't type ':' because Cmd-d is bind to deleteLine.

I tried to remove the Shortcut by adding this to my notebook:
%%javascript

Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('cmd-d');
 
Which yields this error:
Javascript error adding output!
Error: trying to remove a non-existent shortcut
See your browser Javascript console for more details.
 
I guess i need to change Cmd-d to something else but i can't figure out what it needs to be.
I also tried:
ctrl-d
meta-d
alt-d

Does anyone know what to put in there?

Kind regards
Lorenz

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

Matthias Bussonnier

unread,
Apr 3, 2017, 5:02:44 PM4/3/17
to jup...@googlegroups.com
> thanks for the quick answer. I was just wondering if i could not remove that shortcut, because iti s listed nowhere in the jupyter documentation.

That's because it's a [CodeMirror][1] bound shortcut. There are ways
to unset it, likely though jupyter's `custom.js` files, but you will
have to figure out how to change the codeMirror KeyMap. It;s not
documented in Jupyter, because we can't re-document all of the
underlying libraries we use.

--
M

[1]: http://codemirror.net/doc/manual.html#keymaps
> https://groups.google.com/d/msgid/jupyter/4989856d-3d5c-4e83-b555-94f29e0844cc%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages