What are the keyboard shortcuts to comment the code in Android Studio
, both for one line or several selected lines //
,
//Comentar lineas seleccionadas 1
//Comentar lineas seleccionadas
as for a selected code block /* */
.
/*Comentar lineas seleccionadas
Comentar lineas seleccionadas
Comentar lineas seleccionadas*/
For GNU/Linux
Comment selected line or lines (Line Comment) :
Ctrl+/
Comment selected code block (Block Comment):
Ctrl+ Shif+/
for Windows
Comment selected line or lines (Line Comment) :
Ctrl+/
Comment selected code block (Block Comment):
Ctrl+ Shif+/
for MAC
Use the rest of the keys Cmdinstead of followed.Ctrl
Notes: To cancel the comments the same shortcuts, if they are active they are deactivated and if they are deactivated they are activated.
info: http://developer.android.com/sdk/installing/studio-tips.html#q=keymap
You can check which one is defined for in your environment:
File
>>Settings
>KeyMap
clicking on the
teclas/shortcut
defined ones you can change, remove or add them if they are not defined.If you want to use them
atajos del teclado
to generate comments that will be for, generate the documentation of functions, methods, classes, etc., you go to the top line and write/**
+ Enter, it will automatically generate the following pattern.Example:
Start:
Result: