Recently, I switched to using Sublime Text as my main code editor. For over a year, I had been using Visual Studio Code for writing code. The two editors are very similar, but have enough differences that I wanted to share what lead me to using Sublime full time. Note: this post is not about bashing one piece of technology for another. I try to give an honest comparison from my personal experience, but choosing a code editor is a subjective process, so everyone will have a different opinion about their favorite.
What Made Me Switch
Great Symbol Analysis
When you open a project in Sublime Text, it will automatically start a process called “symbol analysis” which is a fancy term for finding keywords in your code. What’s great about symbol analysis is that I can type Cmd + Shift + R to pull up a symbol search menu and quickly find class names and methods throughout my code. I mostly work with PHP so if I already know the class name I'm working on is PostController
, I can search that in the symbol search and immediately have my PHP class file open in the editor.
VS Code does support symbol searches as well, however, it only supports a couple languages out of the box. There is a third-party PHP symbol analyzer that works with VS Code, however, I’ve found that it struggles with large codebases, whereas Sublime has no issue.
Super Fast
Sublime Text is the fastest text editor that you can use for writing code. It opens almost immediately and performs very quick searches. Microsoft has done a good job of keeping VS Code performant, however, VS Code is based on Electron. Electron is a framework for bundling an instance of Chromium and with your code written in JavaScript/Node.js. It makes the editor very extendable, but using an entire instance of Chromium for a text editor makes the app start up slow and use more memory. Sublime Text is a native app written in C++, so its footprint is much lower.
Better Vim Bindings
I really like to use Vim key bindings when writing code. Even though I like Vim keyboard shortcuts, I still like to use a standard text editor to take advantage of modern features like sidebar file lists and file tabs. I have found that Sublime’s Vim support is more accurate than VS Code, which helps me write code a little faster. Sublime supports Vim bindings out of the box, but you can get even more features if you use the Vintageous plugin.
Things I Miss from Visual Studio Code
Feature Rich Sidebar
VS Code has a very good sidebar that allows for more flexibility in creating and moving files. Sublime has a plugin for a better sidebar and there are other keyboard shortcut plugins like AdvancedNewFile that make the transition easier, but I miss the out of the box features of the VS Code sidebar sometimes.
Built in Debugger
VS Code has a built in debugger that works with many programming languages. It makes using PHP’s xdebug really simple. Even though Sublime has debugging plugins, they are not as solid as what VS Code offers out of the box. In this scenario, I will still open VS Code if I’m debugging something tricky.
Conclusion
In the end, text editors are all about personal preferences and job requirements. For my use case, Sublime has been a very enjoyable experience and has helped me write code faster. If you want to learn more about Sublime Text, Jeffrey Way has a course about it on Laracasts and Wes Bos wrote a book on it as well.
Let me know what your favorite editor is in the comments!
Top comments (78)
As a PHP developer I am surprised that you favor Sublime over PHPStorm.
I'm 100% editor based, I've tried PHPStorm but it feels just to heavy for me. Even though I do agree PHPStorm is a great editor and I've got it installed and updated for when the need arises.
But 99.9999% of my time I'm using vim, the other .0001% I'm trying new stuff or learning about the progress of the main editors and IDEs.
Yeah, I use Neovim most of the time, but I use PhpStorm when I want to automatically do a large rename refactor. PhpStorm is impressively accurate and fast for renaming something everywhere it us used. It works well whether you are renaming a method, class, or even an entire namespace along with its' directory.
I tried PHPStorm, but I prefer more lightweight editors. Plus, I wanted to pay for an editor that I can use for more than just PHP.
I actually really love PHPStorm. It's cool and it's just completely awesome. However I've found it's debugger very difficult to setup. I haven't been able to make one successful debug, although, most times, I can read through my code and find issues and it's syntax correction saves a lot of time, but I'd really like to see what's it's debugger can do...
TL,DR; VSCode was just not developed with primary support intentions for PHP.
Having worked with the Big Three (Sublime, Atom, VSCode), I can say that VSCode along with some extensions have proven the best for Node.js and front end web projects.
You ever tried writing a plugin for Sublime Text? Ha ha ha 😂
Actually, I have written an extension for Sublime Text. While the documentation of the python API leaves some things to be desired, it's not too difficult.
I have also contributed to a few VS Code extensions. For someone whose main language is JS/TS, it's definitely easier.
If I was doing more TypeScript or React, VS Code would be really appealing. It will become the standard editor for JavaScript frameworks.
I really like Sublime text. I bought it two years ago. Like you said it's fast.
There is just so many small QoL improvements on VSCode that I switched.
The integrated terminal, the sidebar like you said, Font ligatures (even though the newest version of Sublime has it)
None of these things are really mandatory, but I enjoy them enough for me to make the switch.
I am excited for the next version of Sublime to come out, I bet it's going to be really great. They will improve on all the great stuff from VSCode and Atom, and still make it fast.
I got the developer build of Sublime with font ligatures enabled and it’s really nice. I doubt Sublime will get an integrated terminal, but I already prefer using iTerm as a terminal emulator so that doesn’t bother me. I just want a built in debugger!
github.com/randy3k/Terminus
If you want a good terminal emulator the above is very nice, support for multiple shells, works with WSL... etc.
I use PHPStorm, Sublime and every now and then VS Code, often simultaneously.
Sublime is great for general hacking, scratch pad, logs and certainly more. It’s package ecosystem can put you on par if not decidedly beyond VS Code however the rise of VS Code has made it difficult to keep up with, that and you need to know Python to extend Sublime where as the plugin API for Code is more familiar to those with reasonable JS experience.
Sublime seemed to stagnate with a long time between releases/innovation at one point. Sleeping on the giants so to speak.
Sublime’s speed is unparalleled, that much is inarguable. It’s low footprint makes it hard to ditch entirely.
The only thing I dislike about VSCode might be something you hinted on with the symbol analysis. Within Atom I feel like the suggestions when typing are almost always exactly what I was looking for.
VSCode seems to have trouble with that, for example it won't even suggest a variable I had just defined one line above.
I tried many editors/IDEs, but never left Sublime. ♡
The issue here is that Sublime is more "Text Editor Plus" and VS Code is "IDE Lite". They aren't exactly comparable; at least not the way people seem to want to IMHO. One is a text editor the other is not.
The quality of life you get with VS Code is something I don't think enough people put enough thought/stock into.
Bottom line is use what you want to use; what works for you. We really should stop trying to directly compare VS Code to Sublime. They are both VERY good tools but they definitely are not the same "class" of tool.
I don’t think any editor is exactly comparable because they each have their own goals. However, most developers pick one to use the majority of the time they are coding. In that sense, Code and Sublime are comparable and it’s important to write about strengths and weaknesses of each so programmers can decide for themselves what they want to use.
I actually use both editors. Sublime Text for quick notes and snippets and for basically all hotfixes when I roughly know what I have to do in which file (
subl .
just is really fast).I prefer VSCode in JS-heavy code where I need data from the project context (a task Sublime Text rather sucks at).
However, I have to agree with you that Sublime Text is by far the best jack-of-all-trades text/code editor out there. 👍
I recently switched from VScode to Sublime too.. and I REALLY REALLY REALLY didn't want to do that. I've been using VS code for about 2 years now and have really gotten use to it.. but the lack of speed made it impossible to work with. Maybe when I get a better computer it won't affect my workflow..but as of now, Sublime beats VS code 100x in performance. It hurts to say that but it's the truth
I feel you. I kind of hate the surge in Webkit / Electron apps. They lack the simplicity, speed, and responsiveness of native apps' UIs, scrolling, etc. I totally understand the need, but I'm much happier in apps like Paw and SequelPro than say Slack.
I really like the look of Sublime, but I've stuck with Visual Studio because it has the integrated debugger (I'm developing in Unity 3D). Using one editor is faster than switching between two editors, so no debugger is a deal breaker for me. You mention sublime has debugger plugins which is news to me, how well do they work? Which ones have you tried?
I’ve used this plugin before: github.com/martomo/SublimeTextXdebug. It’s specifically for xdebug/PHP so it won’t work with C#. The plugin works, but isn’t as integrated as VS Code. How do you like using Unity? Is it easier to make games like they say?
I've found a C# and a Unity plugin but I can't find anything that supports debugging. I'll stick with VS for now.
Unity is great, it's incredibly easy to use, and scales well. For beginners and pros, small to big projects. All engines have their problems but Unity makes it very easy. Unreal is a complete pain to use in comparison.
That’s good to know, thanks for responding! I’ve been working on a Swift iOS app which has made me curious about game development. I would like to make a game if the right idea came along.
I've been trying to go back to ST3, but VSCode is simply superior overall in my book. The startup time is a non-argument for me. I can wait two seconds for my editor to open, and the rest of the time, it's fast enough so I never complain.
Besides, Microsoft is doing an amazing job with this editor, and I'm confident the burden of Electron will fade away with time.
If the speed of Electron catches up, then it Code will be really hard to beat.