Adeva5-minute read

Sublime Text 3 Mastery for PHP Developers

As software developers, we spend most of our time staring at code until the bug gets uncomfortable and reveals itself, so we can fix it. On better days, we write fabulous code that we may still be ashamed of after a while. Regardless of the day and its productivity, we spend most of our time in IDEs or text editors. I chose to spend that time in Sublime Text.

Last updated: May 26, 2026

As software developers, we spend most of our time staring at code until the bug gets uncomfortable and reveals itself, so we can fix it. On better days, we write fabulous code that we may still be ashamed of after a while. Regardless of the day and its productivity, we spend most of our time in IDEs or text editors. I chose to spend that time in Sublime Text.

Last updated: May 26, 2026
Aleksandar Pavlov

Aleksandar Pavlov

Senior Software Engineer

Aleksandar is a full-stack engineer with over 8 years of experience in the industry. Over the years, Aleksandar worked with many international startups to helped them release their products on the market faster. He has a skill for writing insightful (and catchy) posts about technology and loves engaging in discussions on a range of thought-provoking topics. When he’s not writing code, you’ll find him playing video games or swimming at the local pool.

Share

As software developers, we spend most of our time staring at code until the bug gets uncomfortable and reveals itself, so we can fix it. On better days, we write fabulous code that we may still be ashamed of after a while. Regardless of the day and its productivity, we spend most of our time in IDEs or text editors. I chose to spend that time in Sublime Text.

I’ve used different IDEs throughout my career, from NetBeans and Eclipse to Visual Studio and others. It is always useful to have something to point out errors before you even try a solution, but for me, IDEs often felt too slow and somewhat laggy.

When it comes to coding with a text editor, the options are broad but can be narrowed down to some of the most popular ones: Vim, Notepad++, Atom, and Sublime Text.

I gave Notepad++ a chance some time ago, but it didn’t work for me. With Vim, my biggest achievement is knowing how to quit. I still haven’t tried Atom, but a colleague of mine is very satisfied with it.

In this article, I’ll show you why I chose Sublime Text and how I made it work for me.

Quick Setup:

Install Sublime Text

  1. Download Sublime Text from their official page.
  2. Install it.
  3. Profit.

Once you’ve installed the basic text editor, you already have a wide range of options available, from creating code snippets to customizing shortcuts and profile settings.

This is a fair enough start, and you may feel comfortable using Sublime Text as is, but there are improvements to be made.

Sublime Text relies on packages to extend its functionality. When the right packages are chosen and configured well, it starts to feel more like an IDE without the laggy side, though it still won’t catch pre-compile errors in the same way a full IDE can.

Package Control

To install packages easily, you’ll need Package Control. To install it, follow the instructions here.

Once installed, you should be able to open the command palette by pressing ctrl+shift+p on Linux and Windows, and cmd+shift+p on macOS.

We’ll use this panel to install the other packages covered in this article. The next section focuses on speeding up code writing with plugins like Emmet.

Emmet

To install Emmet open the command palette as mentioned above by pressing ctrl+shift+p and type Install Package. The first item in the list should be Package Control: Install Package. Click it, wait a second for the next panel to appear, then type Emmet and select the first result.

Congratulations. You just installed Emmet.

Emmet is a collection of shortcuts and snippets that can help you write HTML and CSS faster.

For example, in an HTML document, type ! and press Tab. This will generate a full HTML5 boilerplate. Or try ul>li*5>a.nav and press Tab. This generates a list with five elements, each containing a link with the class nav.

You can also install Emmet extensions if you want more snippets or shortcuts. To do so, repeat the Install Package process, type Emmet in the prompt, and review the available options. If something looks useful, go ahead and install it.

PHP Companion

Again, start with the familiar Ctrl+Shift+P combination and select Install Package, then search for PHP Companion.

Once it’s installed, go to Preferences > Key Bindings. This will open two files. The file on the left contains the default Sublime Text key bindings, while the file on the right contains your user-specific key bindings.

This is where you can set up custom commands. Check the linked documentation for more details.


[
    { "keys": ["f6"], "command": "expand_fqcn" },
    { "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} },
    { "keys": ["f5"], "command": "find_use" },
    { "keys": ["f4"], "command": "import_namespace" },
    { "keys": ["f3"], "command": "implement" },
    { "keys": ["shift+f12"], "command": "goto_definition_scope" },
    { "keys": ["f7"], "command": "insert_php_constructor_property" }
]

Paste that code into your user-specific file, which is the file on the right. Save the changes, then restart Sublime Text.

PHP Companion uses shortcuts like F5 and F6 to find the namespace of a class and either inline it or import it at the top of the file. For object-oriented programming and frameworks that rely heavily on classes and namespaces, PHP Companion can provide a meaningful productivity boost.

Beauty of Code

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” - Martin Fowler, 2008.

Taking the quote at face value, we should aim to write clean, well-formatted, readable, and understandable code. After all, one practical measure of code quality is how easily another developer can understand it later.

That said, let’s jump into the packages that can make this easier.

DocBlockr

This plugin is straightforward. After installing it, open any file, type /**, and then quickly press Tab.

This should generate a block comment section like the one below:


/**
 * [yourMethod description]
 * @param  [type] $parameter [description]
 * @return [type]            [description]
 */

As you can see, it automatically populates parameter names and types when detectable, along with the function’s return type.

Documentation is one of the most important parts of writing good code, and this plugin makes it much easier to manage.

Alignment

Suppose you have the following code:


$apple = “apple”;
$pear = “pear”;
$banana = “banana”;

You can highlight all three lines at once. Press Ctrl+Alt+A, and what you’ll get is:


$apple  = "apple";
$pear   = "pear";
$banana = "banana";

This is especially useful when you have large arrays with many single key => value pairs and want to make them easier to read and edit.

Code Correction

Sublime Text is not an IDE, so helpful hints for custom classes, variables, and syntax errors are not always available. That said, we can still use helpers that let us know when a semicolon is missing, a parenthesis has not been closed, or a similar issue exists before we open the browser to test the code ourselves.

Sublime Linter

Sublime Linter is a basic package that provides syntax error checking out of the box for Python, JavaScript, CSS, and Ruby.

Once installed, it should work right away. Try it yourself: Open a .js file, make a syntax error, and you should see a red dot on the left side near the line number.

For languages that are not automatically available with Sublime Linter, you can install additional packages through the command palette. Press Ctrl+Shift+P, type Install Package, then search for Sublime Linter and select the language of your choice, such as PHP.

I hope you found this article helpful!

FAQs

Q: Is Sublime Text free?

Sublime Text can be downloaded and installed for free, but a license should be purchased for continued use.

Q: Do I need a license for Sublime Text?

Sublime Text can be used during its trial period, but a license should be purchased for continued use.

World-class articles, delivered weekly.

By entering your email, you are agreeing to our privacy policy.

World-class articles, delivered weekly.

By entering your email, you are agreeing to our privacy policy.

Join the Toptal® community.