Try Augment Code: a power tool for pro Laravel devs

My Sublime Text Setup in 2024 for Web Development

Last updated on by

My Sublime Text Setup in 2024 for Web Development image

Sublime Text in 2024 is a powerful, viable text editor that I find delightedly minimal, fast, and productive. While the core of my Sublime setup hasn't changed much, I wanted to share the details of my setup and some essential plugins I cannot live without in 2024. I wrote about my Minimalist Sublime Text 3 Setup for PHP back in 2018 (wow time flies), and I still feel like the heart of my experience is similar in 2024. I aim for a minimal setup. However, I have found some valuable plugins that save time and make me more productive.

My Theme

Sublime has a lot of themes available, and I've tried many of them, but I've found a permanent home with the Monokai Pro theme:

I prefer the Octagon version, but all of them are really, really good, and I am sure you'll find something you'll love. This theme requires a license, but you can try it out before you buy it with popup reminders to buy a license. For me, it's well worth the ~ $13 USD price. I also have the VS Code license as sometimes I'll use VS Code for specific tasks (i.e., Astro has a much better experience in VS Code), and I like the consistency of themes as I jump between editors.

Along with Monokai Pro, I use the paid Operator Mono font (Book) as I find it the most readable coding font I've ever tried. I have also tried out JetBrains Mono, and that's what I'd recommend if you don't want to fork out $200+ USD for Operator Mono.

Font size and spacing is a personal thing, but here's what my font-related settings look like in Sublime Text:

{
"font_face": "Operator Mono Book",
"font_size": 14,
"line_numbers": true,
"line_padding_bottom": 8,
"line_padding_top": 8,
"smart_indent": true,
"spell_check": false,
"tab_size": 4,
"theme": "Monokai Pro (Filter Octagon).sublime-theme",
"word_wrap": true,
"scroll_past_end": true,
}

My Plugins

I will not list out each plugin I have installed, but I'll highlight the plugins I think will have a big impact on making Sublime Text a fantastic editing experience in 2024. I've recently started Using Language Servers in Sublime Text, a huge level up for code intelligence in many languages supported by the Sublime LSP package.

The LSP PHP package (I use Intelliphense) is the only PHP plugin I use with Sublime Text. It does most everything I need, and gives much better code intelligence than the default experience.

Besides the LSP plugin, here's what I cannot live without:

Using static analysis tools like PHPStan is imperative if you want to use a text editor as your primary driver. You'll definitely miss some things. However, the LSP plugin improves calling your attention to these issues.

Snippets

I love snippets, and I recommend developers have their own curated collection of snippets that they can collect over time. Some of my most used snippets are for creating class methods:

pubf - creates a method with public visibility
prof - starts a snippet with protected visibility
prif - starts a snippet with protected visibility

Here's an example snippet from the above pubf snippet:

<snippet>
<content><![CDATA[
public function $1()
{
$0
}
]]></content>
<tabTrigger>pubf</tabTrigger>
<scope>source.php</scope>
</snippet>

Another one I use all the time is the test snippet (which I activate with tab), which creates a phpunit test case:

<snippet>
<content><![CDATA[
public function test_$1()
{
$0
}
]]></content>
<description>Create a PHPUnit Test Case</description>
<tabTrigger>test</tabTrigger>
<scope>source.php</scope>
</snippet>

You can see my paulredmond/sublime-snippets snippets plugin for Sublime. To install this plugin, I use git clone:

git clone https://github.com/paulredmond/sublime-snippets \
~/Library/Application\ Support/Sublime\ Text/Packages/User/sublime-snippets

Your path to user packages might be different! You can find out by going to Sublime Text > Preferences > Browse Packages and then look for a User folder. That path is where you want to copy/clone your snippets.

Version Control

Editors like PhpStorm and VS Code have integrated version control tools and other tools for visual diffs and committing code. I have always used the CLI for Git commands, so jumping between Sublime Text and my terminal isn't jarring. I use Git Mergetool to view diffs and merge conflicts. Another suggestion is to use GitHub Desktop. Finally, Sublime has a companion app for Sublime Text called Sublime Merge, which will give you a similar Sublime experience for your version control.

Learn More

Though some developers have moved on from Sublime Text, I appreciate a minimal, humble text editor. Web developers' toolchains have become incredibly complex, and I long for the days when a text editor's primary role was, well, text editing.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Idea

Ultimate PhpStorm plugin for Laravel developers, delivering lightning-fast code completion, intelligent navigation, and powerful generation tools to supercharge productivity.

Visit Laravel Idea
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Join the Mastering Laravel community logo

Join the Mastering Laravel community

Connect with experienced developers in a friendly, noise-free environment. Get insights, share ideas, and find support for your coding challenges. Join us today and elevate your Laravel skills!

Join the Mastering Laravel community
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Chargebee Starter Kit for Billing in Laravel image

Chargebee Starter Kit for Billing in Laravel

Read article
Streamline Pipeline Cleanup with Laravel's finally Method image

Streamline Pipeline Cleanup with Laravel's finally Method

Read article
Validate Controller Requests with the Laravel Data Package image

Validate Controller Requests with the Laravel Data Package

Read article
Transform JSON into Typed Collections with Laravel's AsCollection::of() image

Transform JSON into Typed Collections with Laravel's AsCollection::of()

Read article
Auto-translate Application Strings with Laratext image

Auto-translate Application Strings with Laratext

Read article