Build Systems in Sublime Text 3

Adnan Ahmed
tajawal
Published in
3 min readMar 29, 2018

--

Sublime has highly customizable build systems that can add to your productivity if you learn how to use them to your advantage. You can define one for your project and whenever you are editing any file, you can run certain commands on the source file and see the output in the sublime console, without leaving the editor.

I mostly use IntelliJ for development but still find myself switching to sublime text time to time, depending upon the nature of the project. I mainly use sublime when I have to write some small script or a library, and when I use it I prefer to setup the build system to make it easier to test. In this post I am going to explain how to create one by creating an example build system for a hello-world php application. But the steps should be same for any language. So let’s get started.

The first thing that you are going to do is create a new build system. You can do that by going to below path

Tools > Build System > New Build System 

This will open a new file named untitiled.sublime-build. Update the file and put the below content

{
"cmd": ["php", "$file"],
"selector": "source.php",
"file_regex": "php$"
}

Now save this file with the name php.sublime-build. To give you some details about the file content;

  • cmd here means the command that we need to run with the arguments that we want to pass it
  • selector is an optional string used to locate the best builder…

--

--

Adnan Ahmed
tajawal

A software engineer sharing insights and experiences through blog posts. Delving into technical topics and occasional general musings. https://adnanahmed.info