0

When I open a bracket, sublime adds a closing bracket for me, placed immediately to the right of the cursor. I'm fine with that.

However, I'd like to be able to type inside these brackets, then be able to hit tab to jump immediately to the right of the closing bracket.

How to make it do this?

There is a partial answer here, saying use the end key, which I don't have as I don't use a numeric keypad. It also says you can map shift+enter, but that's no better for me than my current method, which is to bend my right thumb under my hand to hit the right arrow key – which is slow, for this extraordinarly frequent operation!

mwal
  • 2,803
  • 26
  • 34

1 Answers1

0

Partial solution (due to drawback italicised below):

Add "auto_match_enabled" : false to user settings as per here, then add this snippet:

<snippet>
    <content><![CDATA[(${1})${2}]]></content>
    <tabTrigger>(</tabTrigger>
    <scope>source.java</scope>
</snippet> 

You do have to hit tab to get the closing bracket in the first place, but having done that you are in the snippet so after you've entered params to your hearts content, a second tab will jump past the closing bracket.

A slight drawback is that this does mean you have to hit tab where you didn't before to get a matching bracket where you want to call a method with no params, though...

mwal
  • 2,803
  • 26
  • 34