jupyterlab / jupyterlab-shortcutui

A JupyterLab extension for managing keyboard shortcuts
BSD 3-Clause "New" or "Revised" License
54 stars 15 forks source link

comment/uncomment shortcut #34

Closed dschick closed 4 years ago

dschick commented 6 years ago

thanks for the great extension! Would it be possible to add a comment/uncomment shortcut as well?

NoahStapp commented 6 years ago

Hi @dschick,

Can you be more specific as to what you mean by a comment/uncomment shortcut? Commenting and uncommenting where exactly?

dschick commented 6 years ago

@NoahStapp there is actually a jupyter notebook extension https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/comment-uncomment So I would like to comment/uncomment code in the notebook cells with a shortcut like in spyder, etc

NoahStapp commented 6 years ago

In notebooks the shortcut Control-Slash block comments code. Do you want to be able to change it, or are you looking for that command in general?

dschick commented 6 years ago

I actually would like to change that command, because on a non-english keyboard "slash" is not directly available which makes it hard to use this shortcut

Lef-F commented 6 years ago

Same here! On the Swedish keyboard you have to press Shift + 7 to get / and of course pressing Ctrl + Shift + 7 does not work.

jasongrout commented 6 years ago

FYI, these shortcuts are defined in the codemirror setup: https://github.com/jupyterlab/jupyterlab/blob/156a569cae094edebfbd7a4a7a18aeccbeec1705/packages/codemirror/src/factory.ts#L24-L25 and https://github.com/jupyterlab/jupyterlab/blob/156a569cae094edebfbd7a4a7a18aeccbeec1705/packages/codemirror/src/factory.ts#L34-L35

jasongrout commented 6 years ago

In particular, these don't use the jupyterlab application-wide keyboard shortcut system, so changing these shortcuts would require some work in JupyterLab. Could you open an issue in JupyterLab about changing these shortcut keys?

gustnt commented 4 years ago

@dschick were you able to use the shortcut in non-English keyboard?

dschick commented 4 years ago

@gustnt nope. @jasongrout I linked this issue to https://github.com/jupyterlab/jupyterlab/issues/4778 So we could close it here I guess?

afshin commented 4 years ago

Cheers! Thanks for cross-referencing, @dschick. Let's close it here.