If, like me, you have plugins with a lot of commands, and far too many key bindings, consider this little snippet. It pops up the quickpanel, and lets you choose a command to execute.
class ChooseOutputFormatCommand(sublimeplugin.WindowCommand):
def run(self, window, args):
items =
("Article (pdf)", "compileToPdf"),
("Filofax Pages (pdf)","compileToFilofaxPagePdf"),
("Index Cards (pdf)","compileToIndexCardPdf"),
("Standard Manuscript Format (pdf)", "compileToSmfPdf"),
("Web Page (html)", "compileToHtml"),
("Rich Text Format (rtf)", "compileToRtf"),
("S5 slideshow (html)", "compileToS5"),
("Screenplay (pdf)","compileToScreenplayPdf"),
("Book (pdf)","compileToBookPdf"),
("Book with pagebreaks (pdf)","compileToBookPbPdf"),
("Booklet (pdf)","compileToBookletPdf"),
]
commands = [x for x,y in items]
names = [y for x,y in items]
window.showQuickPanel("", "onOutputChosen", names, commands)
class OnOutputChosenCommand(sublimeplugin.WindowCommand):
def run(self, window, args):
if len(args) != 1:
print "%s items selected; expected 1" % len(args)
return
command = args[0]
print "selected %s" % command
window.activeView().runCommand(command)