Home Download Buy Blog Forum Support

retrieve a list of commands

retrieve a list of commands

Postby FragOnly on Thu Feb 14, 2013 7:26 pm

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

Thanks
FragOnly
 
Posts: 19
Joined: Sat Feb 09, 2013 12:50 pm

Re: retrieve a list of commands

Postby skuroda on Sat Feb 16, 2013 3:10 am

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.
skuroda
 
Posts: 677
Joined: Fri Oct 05, 2012 8:11 am

Re: retrieve a list of commands

Postby FragOnly on Sat Feb 16, 2013 3:25 am

That would allow me to get all the plugin commands.

How would you go about getting all the default commands?

Thanks!
FragOnly
 
Posts: 19
Joined: Sat Feb 09, 2013 12:50 pm

Re: retrieve a list of commands

Postby skuroda on Sat Feb 16, 2013 3:37 am

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
skuroda
 
Posts: 677
Joined: Fri Oct 05, 2012 8:11 am


Return to General Discussion

Who is online

Users browsing this forum: giltig, observingly and 37 guests