For more explanation (and as a weird aside to a potential weirdness in Sublime’s key handling itself), using the following key binding:
{ "keys": ["ctrl+:"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
Pressing Ctrl+: does not do what you want; it opens the Go To Anything
panel with the #
operator already inserted, which makes total sense because (at least under Linux) the key binding Ctrl+; is bound to do that very thing, and that’s actually what key you’re pressing.
However, if you press Ctrl+Shift+;, the shortcut works, because you are actually pressing Ctrl while generating a ;
character.
On the other hand, this binding does NOT work:
{ "keys": ["ctrl+:", "o"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
Now when you do the sequence, instead of word wrap toggling, a regular o
appears in the document, even if you press Ctrl+Shift+;o.
In order for it to work, it needs to be explicitly bound to use the shift key:
{ "keys": ["ctrl+shift+;", "o"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
Now it works as expected.
I imagine this is because of the internal difference in recognizing that a key stroke is bound directly to some command versus recognizing that the sequence might be a part of a key chord sequence, with the rules for matching being a little looser or stronger in one case over the other.