Home Download Buy Blog Forum Support

Repeat last build variant

Repeat last build variant

Postby Tim99 on Sun Mar 17, 2013 7:21 pm

I have a custom build file that goes along these lines:
Code: Select all
{
   "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"]
      },
   ]
}

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 ;-) 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!
Tim99
 
Posts: 2
Joined: Sun Mar 17, 2013 10:45 am

Re: Repeat last build variant

Postby Tim99 on Tue Mar 19, 2013 12:57 pm

No ideas? :roll:
Tim99
 
Posts: 2
Joined: Sun Mar 17, 2013 10:45 am

Re: Repeat last build variant

Postby bizoo on Tue Mar 19, 2013 1:36 pm

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).
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Repeat last build variant

Postby iamntz on Tue Mar 19, 2013 2:50 pm

I think you need my awesome plugin.
iamntz
 
Posts: 915
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Jim and 19 guests