实际上,您不需要自己的插件。你所需要的只是构建变体 http://docs.sublimetext.info/en/latest/reference/build_systems.html#variants。这是使用示例命令的简单示例:
{
"name Script 1",
"cmd": ["shellscript1.sh", "$file"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder:${file_path}}}",
"variants":
[
{
"name": "Script 2",
"cmd": ["shellscript2.sh", "$file"]
},
{
"name": "Script 3",
"cmd": ["shellscript3.sh", "$file"]
}
]
}
将此保存在您的User首选项文件夹为 MyScript.sublime-build。然后,您将能够从构建菜单中选择它,关闭自动目标。
Now, when you press Command+B (on Mac, Control+B on Windows and Linux), the default target executes Script 1, on your file, but you can also select either of the variants.
See 这个答案 https://stackoverflow.com/a/13827685/1309332另外,对于我个人使用的构建文件,为不同的 Make 目标提供变体。