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

10

110

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!

Krouse answered 7/5, 2012 at 11:59 Comment(2)
This is one of the major annoyances for me after switching as well.Mears
I thought that I was the only person annoyed by this problem , thanks god stackoverflow exists! :DEntoderm
L
96

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

Lexie answered 7/5, 2012 at 12:8 Comment(9)
The issue has been moved to Idea Backlog 6984, which means that it won't be implemented in the nearest futureDisrupt
Cmd + Shift + Enter on Mac :)Hight
@PaoloFulgoni One Year passed, it is still hanged up.Gules
This is true for WebStorm and PyCharm as well... probably all JetBrains IDEs, I'm guessing?Pecker
your answer was the best solution , it would've been better if we could change the shortcut.Entoderm
from settings => keymap => Complete ... I changed the shortcut to Alt + ~ , it's way more handy.Entoderm
"Initial implementation for this feature is available in 2018.2 EAP version (just released). 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." - Dmitry Batrak, Jet Brains, 16 May 2018Bluebell
NOW this IDE is my very very favorite one. NEVER ANYTHING ELSE AGAIN!!!!!!!!!!!!! Thank you JetBrains! Even that it took so long, doesnt matter anymore! Im the happiest developer ever! Just wanted to share my happiness with you guys! YAAAY!Stoll
I have to admit: jumping I dislike. I have to jump repeatedly to get to the end of the line. But I very much like the suggestion from bmoran!Speleology
H
11

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.

Holily answered 16/7, 2013 at 15:56 Comment(0)
C
8

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);
Chris answered 21/1, 2015 at 1:51 Comment(1)
Kinda funny. Defeats the purpose a bit.Screech
S
6

I went to preferences->Keymap and set a shortcut for "Move Caret to Line End" to Shift-Space. It takes me to the end of the current line I am on without adding anything, if that's what you want.

Sowens answered 12/4, 2016 at 20:20 Comment(0)
C
3

Not currently supported by Intellij. There is an open feature request on this at http://youtrack.jetbrains.com/issue/IDEA-74666. Extra votes would be nice.

Copious answered 31/10, 2013 at 4:12 Comment(0)
C
3

Intellij supports the ctrl+shift+m shortcut that jumps to the end of the block:

https://www.jetbrains.com/help/idea/2016.2/navigating-to-braces.html

Cummins answered 12/10, 2016 at 9:11 Comment(1)
That's pretty good... but you have to press it twice to get to the endCoulometer
M
2

It's not quite what you're looking for, but you can type the character you are trying to move outside of (a closing paren, for example) and that should pop you outside of the auto-completed character.

Not ideal, but functional as far as I've tested it.

Melanoma answered 3/12, 2012 at 18:5 Comment(0)
T
2

I set these setting:

1) I added Semicolon shortcut to Complete Current Statement:

enter image description here

Instead of using for loop command, I using fori command (because for command needs semicolon character):

enter image description here

2) I added Alt+Semicolon shortcut to Move Caret to Code Block End:

enter image description here

So when I inside the loop, by pressing Alt+Semicolon jumping end of the bracket, by pressing Semicolon I jumping out the bracket subsequently.

by adding these shortcuts, the speed of coding will be faster.

Tremml answered 10/4, 2017 at 21:3 Comment(0)
K
2

Such key is called "End".

You can assign any unused shortcut to "Move Caret to Line End" action in "Settings/Preferences | Keymap".

P.S. You can use Ctrl+Shift+Enter to complete your statement (in your case it will place caret at the end of line and will add ";" there) -- action called "Complete Current Statement" and shortcut can be checked/changed in a same way as described earlier.

Ketchup answered 2/8, 2017 at 0:42 Comment(0)
P
0

If you decide to move back to Eclipse and use PyDev this feature by default is disabled, First Switch to PyDev Perspective and you can enable it by going under Preferences>PyDev>Editor>Typing>Enable link on Automatic parenthesis or literals closing

Pushball answered 25/12, 2017 at 19:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.