I'm a beginner in android programing. I use Android Studio (v0.8.9). Here is problem a tackled with:
Ctrl + Shift + Enter adds a semicolon and moves the caret to the end of the line, Shift + Enter does not a add semicolon and moves the caret to a new line. Question is how to make InteliJ IDEA add semicolon to the end of current line and move caret to the new line by pressing, say, Shift + Enter?
Pressing Ctrl + Shift + Enter twice should do the job. You can record a keyboard macro that does it, and assign a custom shortcut to it.
It's 2020 now and Ctrl + Shift + Enter shortcut now works as expected in Android Studio (tested 4.1.1). MacOS version should have a different modifier, but should be almostly same.
Another way to get the IDE to add semicolon If you have code completion enabled you can press tab on your code snippet, then press shift+enter to go to a new line.
For example:
1. type sout and press tab.
2. the editor fills in System.out.println($CursorHere);
3. type "foobar" where the cursor appears.
4. press shift enter and you'll be taken to a new line.
You can customise your shortcuts in preferences - > Keymap
Edit or add new shorts cut is very easy from here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With