When you run Sublime Build and it finishes, there is a message [Finished ] (in the picture). I would like to add default message when every Build starts to be like "[Started]":
Also it would be nice to add local time when Build System started, e.g. [Started 22:20:23]

The are (at least) three ways to do this. The first way is to add the functionality to the beginning of your code, so it prints out the information you want. The disadvantage of this method is that the message is printed only when the code begins to run, not at the beginning of the build. Depending on the language you're using, whether it's compiled or interpreted, and the size of your codebase, this could be a significant lag.
The second method is to run your build through a shell file which executes using
bash. On Windows, this requires that you havebashinstalled - Git Bash and Cygwin are two common ways of obtaining it. The following script accepts an arbitrary number of arguments, which it runs after printing "Started" and the date.Save this file as
build.shsomewhere in yourPATH.Now, take a look at the
.sublime-buildfile for the build system you're using, specifically the"shell_cmd"or"cmd"line. If it's a"shell_cmd", all you'll need to do is copy and paste it (without the enclosing double quotes) into the build system below. If it's a"cmd", convert the array/list following"cmd":to a single string. So, for example, if you're using the default Python build system on Windows,"cmd": ["py", "-u", "$file"]would becomepy -u $file. Essentially, you're converting the array to what you would type at the command prompt, keeping Sublime-internal variables beginning with$(like$file) intact.Next, select
Tools → Build System → New Build System…. Erase its contents and paste in the following template:replacing
new_cmd_goes_herewith the command string you just created in the step above. So, for our Python example, that line would become:You can uncomment the commented-out lines in the build system template if you wish.
When you're done editing the build system, simply hit CtrlS to save, naming it something like
Python (start message).sublime-build, for example. You don't need to change the directory the file is saved in, as Sublime will automatically put it in yourPackages/Userdirectory.The third option is to modify
Packages/Default/exec.pyto fit your needs. This requires knowledge of Python and Sublime's internals. You can find the basics of how build systems work and how to extend them here.Briefly, you would save
Packages/Default/exec.pyasPackages/User/exec_with_dt.py, setting the read_only flag toFalseif necessary. Next, change the name of theExecCommandclass toExecWithDtCommand. Then, just afterself.procis defined as anAsyncProcess, add a line calling eitherself.append_string()(ST3) orself.write()(ST4) writing your desired string to the output. In ST4, I used:I haven't tested this in ST3, but the following should work there:
Save the file, then create a new build system with the following contents:
I don't recommend this approach unless you really know what you are doing, and the shell script method isn't sufficient for your needs. Other edits may need to be made to
exec_with_dt.pyto ensure complete parallel functionality with the originalexec.py, so look through it carefully. For example, you may want to modifyExecEventListenertoExecWithDtEventListenerand change its code to run theexec_with_dtcommand, just to keep everything in-house.