Sublime Forum

Repeat last build variant

#1

I have a custom build file that goes along these lines:

[code]{
“cmd”: “make”],
“file_regex”: “^(…^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${project_path:${folder:${file_path}}}”,
“selector”: “source.makefile”,
“path”: “/bin:/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/texbin”,

"variants":

  {
    "name": "Everything",
    "cmd": "make", "everything"]
  },
  {
    "name": "Chapter Discussion",
    "cmd": "make", "chapter", "topic=discussion"]
  },

]
}[/code]
There are a lot of other build targets as well. Each one calls make with different parameters, in order to build the whole book, single chapters, and so on. With the help of the build file above, I can call any build variant via cmd+shift+P --> “Build: xyz”. That’s good :wink: However, cmd+B executes the default “make” build and in addition to that I’d like a shortcut to repeat the last build variant.

Is that possible? Any help is greatly appreciated!

0 Likes

#2

No ideas? :unamused:

0 Likes

#3

Pretty sure it’s not possible in standard ST2 or ST3.

However, it’s probably possible using a custom command for the target of your build file (http://docs.sublimetext.info/en/latest/reference/build_systems.html#options).
In ST3, maybe there’s something possible with a plugin using the on_window_command event, not sure (and probably not a very good idea).

0 Likes

#4

I think you need my awesome plugin.

0 Likes