Kashyap
Kashyap

Reputation: 17494

sublime key binding for plugin commands

I did see:


I have installed JSON Reindent in my Sublime (3.2.2 Build 3211). To reindent a JSON I press Ctrl+Shift+P type in JSON Reindent in command pallet and press enter.

I would like to bind a key combo say Ctrl+Shift+J to JSON Reindent command. I already have my own Default (Linux).sublime-keymap in the right place with a lot of overrides. But I'm unable to find command name.

This functionality is brought in by a plugin so command won't be available here. I tried to:

It printed following in console (nothing for JSON reindent).

>>> sublime.log_commands(True)
command: move_to {"extend": true, "to": "eol"}
command: select_all
command: show_overlay {"overlay": "command_palette"}

What do I put for command to bind a plugin's command in my Default (Linux).sublime-keymap?

{ "keys": ["ctrl+shift+j"], "command": "?????" },

Upvotes: 0

Views: 324

Answers (1)

MattDMo
MattDMo

Reputation: 102902

The command you're looking for is found in the plugin's sublime_json_reindent.py file and is, in fact, called as sublime_json_reindent. It can also be found in the Default.sublime-commands file.

Upvotes: 1

Related Questions