Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move out of auto-completed brackets in IntelliJ IDEA (without using the arrow keys)?

I recently switched from Eclipse to IntelliJ IDEA, and found myself wondering how to move the cursor out of a pair of auto-completed brackets.

In Eclipse after I finished typing in a pair of brackets, pressing tab brings me out of the brackets. How can I do the same thing without using the arrow keys?

Many thanks for your help!

like image 405
Marsmensch Avatar asked May 07 '12 11:05

Marsmensch


People also ask

How do I turn off auto complete in IntelliJ?

By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.

How do I get my cursor to move out of brackets?

Space is just a space, and Cmd+Space moves the cursor to the end of the text on that line. Thanks so much!


3 Answers

IDEA doesn't have such feature yet. The closest equivalent is the Complete Current Statement editor action (Ctrl+Shift+Enter).


UPDATE

Initial implementation for this feature is available in 2018.2 EAP version - press Tab to jump out.

It works more like in MS Visual Studio - without visual indication of tab 'exit' position. For now, it should work in Java, SQL, Python and some other files. It will take some time for other languages to catch up - some language-specific code changes are required.

The feature is disabled by default, you can enable it in

Settings -> Editor -> General -> Smart Keys -> Jump outside closing bracket/quote with Tab

enter image description here

like image 177
CrazyCoder Avatar answered Oct 14 '22 22:10

CrazyCoder


Ctrl + Shift + Enter does not seem to work for me in IDEA 12.1.4, but I found the closest feature to what I was looking for was Shift + Enter. This completes the line, creates a new line below the current line and moves the cursor to it.

like image 23
dspies Avatar answered Oct 14 '22 22:10

dspies


You can do this by pressing the closing symbol that you would've pressed otherwise, but was auto completed. For example, if you have just typed the f below, you would press shift and 0 (or closing parenthesis), and it will move your cursor outside of the parenthesis.

String asdf = "hello world";
System.out.println(asdf);
like image 8
user2350459 Avatar answered Oct 14 '22 21:10

user2350459