0

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:

  • bind indent and reindent, no luck
  • bind json_reindent, JSON_Reindent and JSON Reindent, no luck
  • enable command logging via sublime.log_commands(True) in cosole, then did
    • Ctrl+A (select all)
    • Ctrl+Shift+P
    • type in JSON Reindent in command pallet
    • press Enter

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": "?????" },
Kashyap
  • 15,354
  • 13
  • 64
  • 103

1 Answers1

1

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.

MattDMo
  • 100,794
  • 21
  • 241
  • 231