Home Download Buy Blog Forum Support

How do I manually invoke a command?

How do I manually invoke a command?

Postby dserodio on Wed May 02, 2012 8:59 pm

Please forgive the newbie question, but how do I invoke a command (made available by a plugin), other then via a keybinding? I expected all commands to be available in the "Command Pallete", but I installed this plugin (just the command, not the keybindings), and when I go to Command Pallete and type "xml" I don't find any commands...

Thanks in advance.
dserodio
 
Posts: 8
Joined: Mon Oct 24, 2011 1:05 pm

Re: How do I manually invoke a command?

Postby quodlibet on Wed May 02, 2012 9:29 pm

To add a command to the Command Palette you need define it in a .sublime-commands file. The relevant docs are here:
http://docs.sublimetext.info/en/latest/ ... lette.html

The simplest thing to do is to add a line like this:
Code: Select all
{ "caption": "User: Tidy XML", command": "tidy_xml" },

in Package/User/Default.sublime-commands

(Notice that the comma at the end of the line is required unless it's the last entry in the file.)
quodlibet
 
Posts: 511
Joined: Sat Jun 18, 2011 5:53 pm

Re: How do I manually invoke a command?

Postby dserodio on Wed May 02, 2012 9:52 pm

Thanks a lot, not only you linked to the appropriate documentation but also gave me a one-liner to solve my specific issue! :D
dserodio
 
Posts: 8
Joined: Mon Oct 24, 2011 1:05 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 36 guests