Sublime Forum

How add Comments to Keymap file?

#1

Hi All,

How can I add comments to the Keymap (Keybinding) file?

Thank you!

0 Likes

#2
// comment
...

Wait. Doesn’t the left side default file have comments?

0 Likes

#3

No… But is it possible to add them?

0 Likes

#4

The default bindings do indeed have some comments in them, for example the last one in the file:

	// HTML, XML close tag
	{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
		[
			{ "key": "selector", "operator": "equal", "operand": "(text.html, text.xml) - string - comment", "match_all": true },
			{ "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
			{ "key": "setting.auto_close_tags" }
		]
	}

If your question is how you add comments to your own bindings, then @jfcherng answered that above. If your question is can you add comments to the default bindings, the answer is no, the file is read-only and can’t be modified.

If you want to comment the default bindings, copy them to your key bindings file on the right and comment them there .

0 Likes

#5

Thanks! You answered my question!

0 Likes