Comment shortcut Android Studio

后端 未结 24 2661
野趣味
野趣味 2020-12-22 19:55

I\'m searching for useful Android Studio keyboard shortcut for commenting code, as in Sublime Text or Eclipse.

When I press either cmd+/ or

相关标签:
24条回答
  • 2020-12-22 20:11

    Be sure you use the slash (/) on right side of keyboard.

    For Line Comment:

    Ctrl + /

    For Block Comment:

    Ctrl + Shift + /

    You can see all keymap in Android Studio: Help ➤ Default Keymap Reference

    0 讨论(0)
  • 2020-12-22 20:12

    for German Layout (Deutsches Layout) the default is:

    for line Comment: strg + Numpad(/)

    for block Comment: strg+shift+Numpad(/)

    0 讨论(0)
  • Mac:

    To comment/uncomment one line, use: Ctrl + /.

    To comment/uncomment a block, use: Ctrl + Shift + /.

    0 讨论(0)
  • 2020-12-22 20:14

    On Mac and Turkish Keyboard it is (both for commenting out and uncommenting)

    line comment: cmd +.

    block comment: cmd+alt +.

    0 讨论(0)
  • 2020-12-22 20:14

    In the Icelandic MAC keyboard: CMD + -

    0 讨论(0)
  • An Example for a Mac OS X 10.5+ with a German layout keyboard without NumPads:

    1. Open Preferences
    2. Search for "Keymap"
    3. Expand "Main menu"
    4. Expand "Code"
    5. Delete all shortcuts (just a suggestion)
    6. Add a shortcut for a single line comment (e.g. Ctrl++)
    7. Add a shortcut for a block comment (e.g. Ctrl+alt +)
    8. This way you can be sure that those keys are not mapped (except if you assigned them before to another function)

    0 讨论(0)
提交回复
热议问题