Sublime Forum

How to jump to the end after auto-pairing?

#1

If I write “”, Sublime ofcourse adds the “]” automatically and I can write what’s supposed to be in between.
However, in other editors i’ve gotten used to be able to press the TAB key after finnish writing inside the brackets (or any other auto-pairing characters/snippets) to “jump out” of the auto-paired part.

Is this feature already available and i’m just missing it?

0 Likes

#2

Add to your keybindings: [code] { “keys”: “tab”], “command”: “move”, “args”: {“by”: “characters”, “forward”: true}, “context”:

    { "key": "following_text", "operator": "regex_contains", "operand": "^)\"'\\]\\};]", "match_all": true },
    { "key": "auto_complete_visible", "operator": "equal", "operand": false },
    { "key": "has_next_field", "operator": "equal", "operand": false }
]   

},[/code]

0 Likes

#3

Yes, it works! Thank you very much.

But I found after setting it, if I really want to use ‘tab’ to give 4 spaces before characters like “]”,"}", the cursor will jump to the right of the character.
Other IDEs just jump after auto-pairing.
I don’t know if ST2 can do it?

0 Likes

#4

Similar to the above. I got it from this forum, forget who wrote it though… :blush:

/* Set <tab> to pass through auto-filled punctuation */ { "keys": "tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context": { "key": "selection_empty", "operator": "equal", "operand": true }, { "key": "preceding_text", "operator": "not_regex_match", "operand": ":space:]]*", "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\"'\\)\\}\\]]", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false }, { "key": "has_next_field", "operator": "equal", "operand": false } ] },

0 Likes

#5

AWESOME! Thank you all.

0 Likes

#6

[quote=“nick.”]Similar to the above. I got it from this forum, forget who wrote it though… :blush:

/* Set <tab> to pass through auto-filled punctuation */ { "keys": "tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context": { "key": "selection_empty", "operator": "equal", "operand": true }, { "key": "preceding_text", "operator": "not_regex_match", "operand": ":space:]]*", "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\"'\\)\\}\\]]", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false }, { "key": "has_next_field", "operator": "equal", "operand": false } ] },[/quote]

This is very good for me. Thank you.

0 Likes