Sublime Forum

How to key-bind "kebab-case" function

#1

I would love to key-bind the function Edit > Convert Case > kebab-case, but fail. Is it possible at all to add a key binding for this function?

I have tried { "keys": ["ctrl+k", "ctrl+#"], "command": "kebab_case" }, and { "keys": ["ctrl+k", "ctrl+#"], "command": "kebab-case" },, but neither seems to work.

0 Likes

#2

FYI Key Bindings not working

1 Like

#3

Great, thanks a lot, @jfcherng!

The right key binding for the kebab-case conversion is:

{ "keys": ["ctrl+k", "ctrl+k"], "command": "convert_ident_case", "args": {"case": "lower", "separator": "-"} },

(with the keys of your choice, of course).

1 Like