Sublime Forum

Modifying autocompletes

#1

Hi-

I’d like to modify ST to add spaces between curly braces when it auto closes them.

Currently, when you type ‘{’ ST automatically adds the closing ‘}’ What I would like is to have it automatically insert two spaces between the braces, with my cursor right in the middle.

Is this possible?

Thanks!

0 Likes

#2

In the default keybindings, you’ll find: [code] // Auto-pair curly brackets
{ “keys”: “{”], “command”: “insert_snippet”, “args”: {“contents”: “{$0}”}, “context”:

		{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
	]
}[/code]

replace {$0} with { $0 }

(Make sure to put the changes in your user keybindings)

0 Likes

#3

Perfect! Thanks!

0 Likes