Sublime Forum

Wis the default apply scope

#1

I have two key bindings where there is no selector saying which language it should apply.

[
	{ "keys": [" "], "command": "insert_snippet", "args": {"contents": " $0 "}, "context":
		[
			{ "key": "setting.auto_match_enabled" },
			{ "key": "selection_empty", "operand": true, "match_all": true },
			{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
			{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
		]
	},
	{ "keys": [","], "command": "insert_snippet", "args": {"contents": ", $0"}, "context":
		[
			{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\(" },
			{ "key": "following_text", "operator": "regex_contains", "operand": "\\)" }
		]
	}
]

My question is simple, if I don’t mention which langauge it should apply, so it apply to all language?

0 Likes

#2

so it apply to all language?

That is correct. Keybindings are global and you have to use the "context" to narrow it down.

0 Likes