2

I am using a MacBook Pro with a Swiss German keyboard and am unable to use the toggle line comment keyboard shortcut. This happens when using CLion, PyCharm or Google Colab.

I have found these similar questions online: how-to-press-cmd-on-german-keyboard-layout, line-comment-shortcut-on-german-keyboards, vscode github issue with similar discussion. This is also very similar shortcuts not working and it seems like lots of European keyboards deal with this kind of problem.

The general suggestion e.g. for IntelliJ seems to be to change the shortcut for whichever application you are using at the moment. I also found this specifically for Google Colab how-to-do-block-comments-in-google-colab-on-a-mac-with-a-non-american-keyboard. There one person states that cmd+shift+ß for cmd+/ on their German keyboard but I do not have a ß on my Swiss German keyboard.

One solution that keeps popping up is to use the numeric keypad, but this will not work on most laptops.

I also checked the Google Colab shortcut settings to see if I could just change the shortcut there but as in the other question, this is one of the few shortcuts that cannot be changed.

Does anyone know a solution to this? It keeps coming up and can be quite cumbersome especially in python if you want to comment out several lines of code. Maybe is there a way to achieve cmd+/ with a different shortcut?

Edit: I came across another person asking basically the same question: is-it-possible-to-do-block-comments-in-google-colab. One comment mentioned that on a MacBook with keyboards that have that problem, line comments work with ctrl+cmd+shift+7. This worked, though only in Safari, not Firefox.

2nd Edit: In case someone else finds this question/has the same problem: Here I found a solution for jupyterlab: How do I block comment in Jupyter notebook? [closed]

paul
  • 21
  • 5
  • 1
    I don't have a solution for this (neither do I have your particular keyboard to test it). But if you can't choose [a keymap](https://www.jetbrains.com/help/pycharm/mastering-keyboard-shortcuts.html#ws_print_keymap) that suits you the best solution is [assigning your own shortcut](https://www.jetbrains.com/help/pycharm/configuring-keyboard-and-mouse-shortcuts.html). Even with a standard keyboard I end up having to assign costum shortcuts for several actions. – bad_coder Mar 31 '23 at 04:14
  • 1
    Thanks, this works for PyCharm! I came across a "solution" to Google Colab as well, I edited my original question with that solution. – paul Apr 01 '23 at 12:30

0 Answers0