Sublime Text 3 Plugins for Frontend Web Development Sublime is great and for many still the best text editor available. But out of the box, it lacks some features that modern competitors have already built-in. Plugins help to stay ahead but it's a hassle to keep up with all of them. Sublime Text 3 (ST3) is a lightweight, cross-platform code editor known for its speed, ease of use, and strong community support. It’s an incredible editor right out of the box, but the real power comes from the ability to enhance its functionality using Package Control and creating custom settings. Sublime Text 3 was officially released on 13 September 2017. Two of the main features that Sublime Text 3 adds include symbol indexing and pane management. Symbol Indexing allows Sublime Text to scan files and build an index to facilitate the features Goto Definition and Goto Symbol in Project. Pane Management allows users to move between panes via hotkeys. Actually, I don't want to used crack version. But, $80 is pricey. Now, I'm not using anymore for crack version and willing to pay if around $50. Better used unregister version. Guys, please respect to Sublime's developer. At least, we can still used without license. Apologies to Sublime text team. Hope your guys amend price. Apr 27, 2018  So there we have it — the ten essential Sublime Text plugins for JavaScript development. I urge you to give one or two of them a try and to let me know how you get on in the comments. Sep 25, 2019  Actually, I don't want to used crack version. But, $80 is pricey. Now, I'm not using anymore for crack version and willing to pay if around $50. Better used unregister version. Guys, please respect to Sublime's developer. At least, we can still used without license. Apologies to Sublime text team. Hope your guys amend price.

!
Warning: This post is over a year old. I don't always update old posts with new information, so some of this information may be out of date.

A lot of folks in the PHP community have been checking out PHPStorm lately, including myself and most of the developers I work with. We love the code intelligence we get from PHPStorm, but still miss the speed, quick boot-up, and convenience of Sublime Text.

Before I blindly assume PHPStorm is the only way to go, I wanted to see: Can I bring the things a PHP-focused IDE provides PHP developers back to Sublime Text and get the best of both worlds?

Let's start with a quick list of ways that PHPStorm really sets itself apart for me. Please note: There are a million other features that PHPStorm uniquely offers, but to be honest, it's the tiny little conveniences that I've seen provide the biggest boost in efficiency.

Also note: This is Sublime Text 3 we're talking about.

My Must-Haves From PHPStorm

Without most of these wonderful PHP-focused features, it'll be hard to recommend using something other than PHPStorm, even if it's slower and costlier and uses more memory. So. Can we reproduce them in Sublime Text?

  • Auto-use (import) of classes
  • Class FQCN inline completion
  • Easily navigate to a symbol's definition
  • Easy constructor injection
  • Highlight unused imports
  • Git gutters
  • Code sniffing/PSR-2 validation
  • Code Completion: PHP
  • Code Completion: project code

Package Control

Before we talk about anything else, you at least need to know how to install packages in Sublime Text.

If you haven't yet, Go install Package Control now.

Unless otherwise specified, every package after this should be installed using Package Control.

Sublime PHP Companion

The most significantly PHP-focused package for Sublime Text is called Sublime PHP Companion.

Like most packages, it contains a series of actions you can perform. They're mapped to certain keys by default, but you can always re-map them. Update: there is no keymapping by default anymore. Learn more about how to set up PHPCompanion keymapping here.

  • find_use (F10) - When your cursor is over a class name, this command makes it simple to use (import) that class.
  • expand_fqcn (F9) - Same as find_use but instead of expanding the class in the import block, it expands its FQCN inline.
  • import_namespace (F8) - Adds the namespace for the current file based on the file's path.
  • goto_definition_scope (shift+F12) - Same as Sublime Text's native goto_definition (described below), but scoped in a PHP-aware manner.

The package isn't perfect, and it is clearly not as bright as PHPStorm is when it comes to detecting namespaces and parsing some weird edge cases. But for day-to-day work, this is a huge boost in the PHP-code-knowledge area.

AllAutocomplete

Sublime PHP Companion doesn't sniff your classes and give you autocompletion, sadly, but SublimeAllAutocomplete does register the names of all symbols (functions, classes, etc.) in any files you have open in other tabs and add those to the autocomplete register.

This isn't quite the same as full userland-code-sensitive autocompletion, but it helps a lot.

Cmd-click for function definition

Sublime PHP Companion makes it easy to right click on functions and go to their definitions, but this shortcut brings back PHPStorm's CMD-click-to-definition. FYI, in Sublime Text CMD (or windows' ctrl key or whatever it is on other systems) is called 'Super'.

First, create a user mousemap file. If you don't have one, go here:

Linux
Create Default (Linux).sublime-mousemap in ~/.config/sublime-text-3/Packages/User

Mac
Create Default (OSX).sublime-mousemap in ~/Library/Application Support/Sublime Text 3/Packages/User

Windows
Create Default (Windows).sublime-mousemap in %appdata%Sublime Text 3PackagesUser

Next, place this in the file:

You just taught Sublime Text this: 'when I hold ctrl and click button one, fire the goto_definition command.' Done! (original source)

Note: I originally wanted to suggest using the super modifier, so it would be just like PHPStorm; however, that would override Sublime Text's 'hold super and click to get multiple cursors' behavior, so I didn't.

Code sniffing and PHP_CodeSniffer

Sublime PHPCS

There's a package named Sublime PHPCS that brings PHP_CodeSniffer, PHP's linter, PHP Mess Detector, and Scheck (?) to bear on your code.

You can tweak all sorts of settings, but you're primarily either going to run it every time you save your file (good, but can get annoying), or every time you trigger it from the command palette (press super-shift-p and then type until you get 'PHP Code Sniffer: Sniff this file') or keyboard shortcut (ctrl-super-shift-s by default).

You'll get gutter highlights and a list up top of all of the places your code doesn't satisfy the linter.

The few 1.0.0 youtube. As a basic requirement, users need to provide the following information before any assistance can be offered:.Operating System: Android/Windows/OSX, etc.Device: Nvidia Shield/FireTV, etc.Add-on affected: Exodus/Venom/Seren, etc.Version of Kodi: 17.6/18.2, etc.Version of add-on: 1.1.10/1.1.11, etc.Country: USA/Australia/UK, etc.Any support services: Real-Debrid/Premiumize/Trakt, etc.Link to a.8) No referral links. If there is already an advertisement of your own site on the first page, wait until it drifts off of it before posting another advertisement.7) Include all information when asking for assistance.

Note that this and any other packages that rely on code sniffing and linting will be requiring command line applications installed, so be sure to visit their sites and read their directions.

PHP_CodeSniffer Sublime Text 2/3 Plugin

Interestingly, there's a relatively un-noticed plugin doing the same thing (but for PHPCS only) that's written by the same group that wrote PHP CodeSniffer, so it might be worth checking out as well; it's called PHP_CodeSniffer Sublime Text 2/3 Plugin (creative, I know.)

Sublime

I've never used this one, though, so proceed with caution.

Mike Francis PHP CS Fixer Build Script

Mike Francis also shared a custom build script he wrote that runs PHP-CS-Fixer on your code whenever you trigger it. That means it'll actually enforce PSR-2 (or whatever other PHP-CS-Fixer standard you pass it) on your code for you.

Taylor Otwell actually shared this same script with me, but he didn't write it up as nicely as Mike did. :) He did, however, mention that you might want to set this preference: 'show_panel_on_build': false, This'll keep it from popping out the command panel with your results every time, which can get very irritating very quickly.

SublimeLinter

SublimeLinter PHP (and its required dependency, SublimeLinter) rely on PHP's built-in linter (just like the Sublime PHPCS plugin above). This is a simpler version that only runs the linter, nothing else.

DocBlockr

If you're the type to use PHPStorm, there's a greater chance that you're the type to write Doc blocks. (Just sayin').

DocBlockr makes it simple to create new doc blocks, but more importantly, if you create a doc block just above a defined function, it will extract that function's parameter information and pre-fill it in your doc block. Boom.

Git helpers

Sublime Text Git

Are you the type that hates switching from your IDE to your terminal/Git client? Sublime Text Git provides access to many Git commands directly from the Sublime Text command palette.

GitGutter

GitGutter shows you diff information regarding each line's status--has it been modified, inserted, or deleted?

This is not nearly as powerful as PHPStorm's Git gutters, but it's a step in the right direction.

Syntax Highlighting

  • PHP-Twig for Twig
  • Laravel Blade Highlighter for Laravel Blade
  • Bracket Highlighting - shows the start and end bracket in the gutter for the block your cursor is currently in

PHPUnit Build

There's a great plugin that makes it super easy to run PHPUnit from the command palette or a keyboard shortcut: SimplePHPUnit

Just like the name implies, you install the package and you're up and running.

CodeIntel

CodeIntel is supposed to provide Sublime Text intelligence about the language you're working in. It should provide autocompletion, easy jump-to-definition, and information about the function you're currently working in.

Why do I keep saying 'should' and 'supposed to'? Because I have yet to meet a PHP developer who can get CodeIntel up and running consistently and predictably. Have you? Hit me up.

Other Plugins

When I asked around on Twitter, plenty of folks shared plugins. Since I don't use these, I can only share them vaguely, but I'm sure they're all worth a quick check.

  • ApplySyntax extends Sublime Text's ability to determine which syntax to apply to your current file
  • DashDoc makes it easy for Mac users with the Dash application to look up any word in Dash
  • Function Name Display adds information to the status bar about the current file, class, and function/method name
  • phpfmt looks like an alternative to PHP CS Fixer
  • CodeComplice is code intel, but newer—maybe this is the solution?!
  • EditorConfig is a standard to share particular editor configuration patterns for each project. This plugin lets you import and use them in Sublime Text. (learn more about the EditorConfig format)
  • SublimePrettyJSON is great for quickly formatting JSON
  • CaseConversion makes it simple to convert between snake_case and camelCase and PascalCase and split and join words and everything else.

CodeBug for Xdebug

Do you miss the Xdebug integration in PHPStorm? Check out Codebug, a standalone xdebug client.

A Few General Sublime Text Tips

This post is not an introduction to all things Sublime Text, but I do want to cover a few important pieces here.

Finding files with 'Goto Anything' (cmd-p)

If you press super-P you'll get the wildly powerful Goto Anything palette, which allows you to easily find files, but you can go a bit further: if you find your file (e.g. by typing Handler.php), you can also trigger opening it at a certain line (Handler.php:35) or at a certain symbol (Handler.php@report).

Finding commands with the Command Palette (cmd-shift-p)

While the Goto AnythingGraphisoft archicad 21 full crack + patch (mac os x). palette lets you search for files in your project, the Command Palette allows you to search for commands.

This means that any command that Sublime Text lets you perform (run builds, rename files, etc.), but also those from third-party packages (Sniff this file, etc.) can be run purely from the keyboard, even if you don't know (or have) the keyboard shortcut.

Finding symbols with 'Goto Symbols' (cmd-r)

If you press super-R you'll get the Goto Symbol palette, which will navigate to any symbol in your current file.

Symbols are things like classes, methods, or functions.

Multiple cursors

Many editors have added multiple cursors, but Sublime Text still does it the best.

If you've never tried it, go learn about it somewhere, but here's a quick intro:

Open up a file. Hold 'super' (cmd on Mac) and click several places around the file. Now start typing. BOOM.

Another great trick: Place your cursor on a common word (for example, a variable name). Now press Super-D a few times. You now have several instances of that variable selected and you can manipulate them all at once.

Or, select five lines and press Super-shift-l. Check it.

There's a lot more you can do with this if you get creative.

Fuzzy matching

Did you know that when you're using any of the command palettes in Sublime Text, you don't have to finish one word?

In most editors (like PHPStorm), if you wanted to find a file named resources/views/conferences/edit.blade.php, you could type resources/views/conferences/edit.blade.php or conferences/edit.blade.php, but in Sublime Text all you would need is something like resvieconedblp. Just type enough that the order of letters you're typing could only exist in the string you're looking for, and you'll be good to go. Skip a letter here, skip a slash there--no problem.

Miscellany

There's a lot more to learn about how Sublime Text works, and a lot of tools and courses available to you. This is not a comprehensive resource for everything that's great about Sublime; those guides have already been written.

If you want to learn more about Sublime Text, there are two excellent resources I'd consider checking out.

  • Sublime Text Power User is a book and video series by my friend Wes Bos that teaches you everything you need to use Sublime Text like a boss. It's the easiest way for someone new to Sublime Text to get up and running quickly. Also, I reached out to Wes and he gave me a GEEK coupon to get you $10 off (disclaimer: it helps me out, too.)
  • ShortcutFoo is a great resource for learning keyboard shortcuts for any environment. They've got programs for everything from Vim to Sublime Text to Photoshop to Excel.

Sublime Text 3 Dev

The Verdict

Let's take a look at our list and see what we've handled:

Sublime Text 3 Dev License

  • Class FQCN inline completion (Sublime PHP Companion)
  • Easily navigate to a symbol's definition (Sublime PHP Companion)
  • Navigate to a symbol's definition (Sublime PHP Companion)
  • Easy constructor injection (Macro?)
  • Highlight unused imports (SublimeLinter)
  • Git gutters (GitGutter)
  • Code sniffing/PSR-2 validation (SublimePHPCS etc.)
  • Code Completion: PHP
  • Code Completion: project code

Not bad, actually. Let's talk about what's missing:

  • Construction injection (e.g. simplifying injecting a property into the constructer as a property, setting it in the constructor, and defining the class property) is something I think can be solved with a clever macro—but I haven't seen that clever macro yet.
  • CodeIntel purports to offer PHP code completion, so it's just a matter of getting that working. But I don't think (correct me if I'm wrong) anything in the Sublime Text world claims to sniff the definitions of your code and then provide autocompletion and parameter suggestion. So that's a big shortcoming for sure. Note, however: AllAutocomplete definitely relieves this pain a little.

What's my verdict? As always, it depends. I think it'll depend some on the project, some on the developer, and some on whether or not I can find solutions to some of the issues above. But I'm definitely leaning on Sublime Text a lot more than I was six months ago—it's just so darn fast.

Postscript

Are there any Sublime Text tips for PHP developers that I missed? Let me know on Twitter.

Are there any PHPStorm features that I didn't cover here that you think are vital to every developer's toolkit? Let me know that too.

Also: I couldn't've written this without Adam Wathan, Taylor Otwell, Jeffrey Way, and many, many other friends on Twitter.

Tags: sublime text • php

Look for SublimeText on one of Wikipedia's sister projects:
Wiktionary (free dictionary)
Wikibooks (free textbooks)
Wikiquote (quotations)
Wikisource (free library)
Wikiversity (free learning resources)
Commons (images and media)
Wikivoyage (free travel guide)
Wikinews (free news source)
Wikidata (free linked database)
Wikipedia does not have an article with this exact name. Please search for SublimeText in Wikipedia to check for alternative titles or spellings.
  • Log in or create an account to start the SublimeText article, alternatively use the Article Wizard, or add a request for it.
  • Search for 'SublimeText' in existing articles.
  • Look for pages within Wikipedia that link to this title.

Other reasons this message may be displayed:

  • If a page was recently created here, it may not be visible yet because of a delay in updating the database; wait a few minutes or try the purge function.
  • Titles on Wikipedia are case sensitive except for the first character; please check alternative capitalizations and consider adding a redirect here to the correct title.
  • If the page has been deleted, check the deletion log, and see Why was the page I created deleted?.
Retrieved from 'https://en.wikipedia.org/wiki/SublimeText'