Navigate to nearest right }

Hi!

Is there a way to move out side of nearest } without my hands leave it's position? I can certainly use DOWN and RIGHT keys but my right hand must leave "hjkl"-position.

Ctrl+] moves to left of }. Then I have to press RIGHT key to move to right side.

I have PC-keyboard.

Following is the scenario:

I write: public int foo() {
and press ENTER, intellij completes } automatically, so I have

public int foo() {

}

and my cursor is at the middle blank line. I type: return 0;

Now I want to move to after } so I can type next method quickly. Everytime my hands leave the original position is a productivity loose. :-)



/Wei

7 comments
Comment actions Permalink
Ctrl+] moves to left of }. Then I have to press RIGHT key to move to right side.


i use ctrl+] and then shift+enter
actually it is double shift+enter


upd:
i've record macro and bind it to ctrl+alt+]

0
Comment actions Permalink

How about Control + Shift + Enter twice? It looks to me to do exactly
the job.

Vaclav


Yuwei Zhao wrote:

Hi!

Is there a way to move out side of nearest } without my hands leave it's position? I can certainly use DOWN and RIGHT keys but my right hand must leave "hjkl"-position.

Ctrl+] moves to left of }. Then I have to press RIGHT key to move to right side.

I have PC-keyboard.

Following is the scenario:

I write: public int foo() {
and press ENTER, intellij completes } automatically, so I have

public int foo() {

}

and my cursor is at the middle blank line. I type: return 0;

Now I want to move to after } so I can type next method quickly. Everytime my hands leave the original position is a productivity loose. :)



/Wei

---
Original message URL: http://www.jetbrains.net/devnet/message/5240958#5240958

0
Comment actions Permalink
How about Control + Shift + Enter twice? It looks to me to do exactly

the job.


it works only after return statement
if your method doesn't end with return statement ctrl+shift+enter won't go outside method
and author wants shortcut to go outside any {} block, not just outside methods

0
Comment actions Permalink

Thanks a lot. It works well.

0
Comment actions Permalink

Thanks Wi Wi, it works well.

0
Comment actions Permalink

The VI emulation plugin (IdeaVIM) will let you use hjkl to navigate around instead of arrows. This is why I like the VI plugin, almost never have to remove hands from home row.

0
Comment actions Permalink

Thanks, I am not aware of its existence. It's a great tip. The productivity can be increased even more.

0

Please sign in to leave a comment.