Reputation: 7020
How can I block comment a selected text in an IPython Notebook with a German keyboard layout? Ctrl-/ does not work, which on a German keyboard actually is Ctrl-Shift-7.
Upvotes: 13
Views: 12016
Reputation: 11
I found a comment by AlexanderMelde on GitHub which helped me out that is worked for me:
Strg + /
using the devide key from the numpad instead of the one with the "7" works for me with German keyboard layout.
Hope it also works for you!
Upvotes: 1
Reputation: 409
On a Nordic keybord (and I think this goes for German as well) simply hit Ctrl+Shift+7 (=Ctrl+/)
Upvotes: 0
Reputation: 1
Well after trying every combination with ctrl, voilà, ctrl-# does the job.
Upvotes: 0
Reputation: 1065
I used it with nbextensions. Install it. See docs here
Then, in your nbconfig.
Just configure it with your personal preference. I am using german keyboard and used this implementation successfully for months.
Upvotes: 2
Reputation: 545
I found this great workaround for international keyboard layouts from Dataman in How do I comment out multiple lines in Jupyter Ipython notebook?
Press the
Alt
button and keep holding it. The cursor should change its shape into a big plus sign. The next step is, using your mouse, to point to the beginning of the first line you want to comment and while holding theAlt
button pull down your mouse until the last line you want to comment. Finally, you can release theAlt
button and then use the#
character to comment.
Upvotes: 13
Reputation: 2414
You can define custom keyboard shortcuts in custom.js
. For Jupyter this file is located in .jupyter/custom/
. On a German keyboard layout I use Ctrl
+ ,
as a shortcut to comment by adding this to custom.js
:
define([
'base/js/namespace',
'base/js/events'
],
function(IPython, events) {
events.on("app_initialized.NotebookApp",
function () {
IPython.Cell.options_default.cm_config.extraKeys = {"Ctrl-," : "toggleComment"};
}
);
}
);
Upvotes: 0