Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to comment a block of code in Android Studio [closed]

It seems I'm unable to comment out blocks of code in Android Studio using the CTRL + SHIFT + 7 (on my Lenovo Yoga 2 Pro there's no Numpad and hence no / character on its own button).

Pressing the above combination creates a bookmark with the number 7 instead.

Does anyone know a workaround or am I just stuck with /* *\?

like image 727
Kenneth Avatar asked Jul 31 '14 12:07

Kenneth


People also ask

How do you turn a block of code into a comment?

Comments can be added to single lines of code (Ctrl + /) or blocks of code (Ctrl + Shift + /).


1 Answers

The problem is that the binding is to the main character on the key, which on your keyboard is 7, not /. As I commented before, you might want to try if pressing the Ctrl- works (that is the location of / on my US International keyboard).

Otherwise, I'd suggest you map it to another combination. I don't have Android Studio, but in IntelliJ IDEA (which has the same foundation as Android Studio) this can be configured under File, Settings, Keymap (Main Menu > Code > Comment with Line Comment) or just search for line comment.

like image 92
Mark Rotteveel Avatar answered Oct 23 '22 09:10

Mark Rotteveel