All Projects → jisaacks → ChainOfCommand

jisaacks / ChainOfCommand

Licence: other
Sublime text plugin to run a chain of commands

Programming Languages

python
139335 projects - #7 most used programming language

Chain of Command

Sublime text plugin to run a chain of commands


Usage

To run a chain of commands you run the chain window commands and pass it a list of commands to run. Each command is defined as a list where the first argument is the name of the command to run and any additional arguments will be passed directly to the command.

For example, to run the select_all command and then run the copy command you would call:

window.run_command("chain",{"commands":[["select_all"],["copy"]]})

Or if you wanted to focus the first group in a window:

 window.run_command("chain",{"commands":[["focus_group",{"group":0}]]})

The point is to be able to build custom key bindings to run a sequence of commands. Lets say you wanted a key binding to duplicate the current file. You could set this key binding:

{
  "keys": ["super+shift+option+d"], 
  "command": "chain", 
  "args": {
    "commands": [
      ["select_all"],
      ["copy"],
      ["new_file"],
      ["paste"],
      ["save"]
    ]
  }
}

This would select all the text, copy it, create a new file, paste the text, then open the save file dialog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].