Sublime Forum

Retrieve a list of commands

#1

Is it possible to retrieve a list of commands (like what you would see in the command palette) from a plugin?

Thanks

0 Likes

#2

Don’t think that is built in, but you can probably read the sublime-commands files and get whatever information you want. That’s what I do to look at keybindings associated with the various plugins.

0 Likes

#3

That would allow me to get all the plugin commands.

How would you go about getting all the default commands?

Thanks!

0 Likes

#4

So you can get a list of the packages (well the directories) by using the Sublime API. You can then look through those directories for Default.sublime-command files. Those are simply JSON files, so after parsing you can extract whatever information you want from it. The below link is a portion of my code that reads key map files. I want to clean it up some, but let me know if you have any questions.

link

0 Likes