Hugo Gresse Hugo Gresse - 2 months ago 30
Android Question

Comment shortcut Android Studio

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

When I press either

cmd + /
or
cmd + maj + /
nothing happens...

Answer

Mac With Numeric pad

Line Comment hold both: Cmd + /

Block Comment hold all three: Cmd + Alt + /

Mac (french?)

Line Comment hold both: Cmd + + =

Block Comment hold all three: Cmd + Alt + + =

Issue: on some mac Keyboard, there is not numeric pad so the Android Studio shortcut is not correct. Fix : edit shortcut to alt + / or alt + maj + / for block comment and its working as it should (it's displaying alt. in the keymap). Note : it will override some Mac shortcuts like the backslash \) which is already defined on alt + maj + /.

UPDATE 7/01/2015: on every mac, it seems that Cmd + + = is working perfectly.


Windows/linux :

Line Comment hold both: Ctrl + /

Block Comment hold all three: Ctrl + Shift + /

Same way to remove the comment block.