What are the keyboard shortcuts to comment code in Android Studio?
What are the keyboard shortcuts for commenting code in Android Studio
, for either one line or multiple selected lines //
,
//Comentar lineas seleccionadas 1
//Comentar lineas seleccionadas
As for a selected code block /* */
.
/*Comentar lineas seleccionadas
Comentar lineas seleccionadas
Comentar lineas seleccionadas*/
2 answers
For GNU / Linux
Comment selected Line (s):
Ctrl + /
Comment block of selected Code:
Ctrl + Shif +/
For Windows
Comment selected Line (s):
Ctrl + /
Comment block of selected Code:
Ctrl + Shif +/
For MAC
Use Cmd instead of Ctrl followed by the rest of the keys.
Notes: to override comments the same shortcuts, if they are active they are disabled and if they are disabled they are activated.
Info: http://developer.android.com/sdk/installing/studio-tips.html#q=keymap
You can query which is defined for in your environment:
File
>> Settings
> KeyMap
By clicking on the defined teclas/shortcut
you can change, remove or add them if they are not defined.
If you want to use the atajos del teclado
to generate comments that will be for, generate the documentation of functions, methods, classes etc.. you put yourself on the top line and write /**
+ Enter will automatically generate the following pattern.
Example:
Home:
/** + EnterKey
public void myCar(String name, String color){
//tú código
}
Result:
/**
* @param name
* @param color
*
/
public void myCar(String name, String color)
{
//tú código
}