I\'m searching for useful Android Studio keyboard shortcut for commenting code, as in Sublime Text or Eclipse.
When I press either cmd+/ or
On PC it's by default set to Ctrl + /. This will toggle commenting a selection or current line.
For multiline comment in android studio
select the statement that you want to commented then
use ctrl+shift+/
and for removing mutiline comment
select the statement that you want to uncommented then
use **ctrl+shift+/**
SINGLE LINE COMMENT
For single line comment
use ctrl+/
If you are used with Eclipse, there is something in Settings>Keymap Keymaps: and you can pick Eclipse to keep the same shortcuts.
I use this sequence (not a 'linear' shortcut but useful anyway):
(they use the android studio menu)
In android studio you can do single comment with (go to line then Ctrl+/) and block comment with ( select text then Ctrl+Shift+/)
Also if you want to change color of commented text
go to File->Settings->IDE settings->Editor->Color & fonts->Java->(Line comment or block comment)
and change properties.
I prefer it to be green which is used in notepad++ editor.
For Line Comment hold both:
Ctrl + /
For Block Comment hold all three:
Ctrl + Shift + /
Same way to remove the comment block.