Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In IntelliJ code complete, how can I make the cursor end up inside the parens, not after them

When using code completion for beginner tutorials in IntelliJ, it keeps putting the cursor after the parens, forcing me to hit the left key each and every time.

Using a pipe to represent the cursor: "printl" completes to "println()|" when what I need is "println(|)"

With the second, if you type a " after completion you would get println("") but at the moment what I get is println()""

I know it seems a simple thing but when you have to keep moving your right hand off the keys in order to hit the <- arrow for about 75% of your lines, it becomes the thing that slows you down and gets old really fast.

Thanks, Scott

like image 420
scottstoll2017 Avatar asked Oct 15 '25 03:10

scottstoll2017


2 Answers

Using a Live Template with $END$ in between the quotes was exactly what I needed.

Now if I could just figure out either how to edit the stock println() to include the $END$ or make my live template show on the top of the list instead of the bottom.

Having to reach over to select the right template kind of defeats the purpose of making one so I don't need to reach over to move the cursor lol

like image 115
scottstoll2017 Avatar answered Oct 17 '25 17:10

scottstoll2017


In the list, you can select on overload of "println" that has some parameters.

If you're printing to stdout, you can alternatively use a live template: type "sout" and press Tab.

like image 40
Peter Gromov Avatar answered Oct 17 '25 16:10

Peter Gromov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!