Whether you are a developer switching to the Mac or you’re just shopping around for a nice new editor, you are spoiled for choice when it comes to text editors. Here are my candidates for best text editor for Mac OS X, with some pros and cons of each. Check out my recommendations
The main things I look for in a text editor apart from speed and stability:
Good support for projects. I like to be able to drag a folder from the Finder onto the app and have it open a new project browser. When I’m editing a file I want a simple key command to add a new file to the same folder, and for Command S to open a save dialog that saves by default in that folder (I know this seems obvious). I also want a key command like Command Shift F that will let me find any string, and it should default to the currently open project. The find should also have a Find in File option, and a Replace function that is flexible and fast (I often have to do a find and replace on URLs in MySQL .sql backups for example). All the permutations of Find should support regular expressions.
Great support for Plugins, Clippings, Scripts, Triggers, and what have you. Editors can’t do everything, so it’s important that they expose some kind of scripting engine so that you can do all the tweaking you need. All of the apps below do this, all in different ways.
BBEdit has been around basically forever and is mature, fast, and reliable. I don’t think it has ever crashed on any of my Macs, but I’ve been using it so long that it must have at some point. BBEdit is not the most modern editor around: it doesn’t do code completion, for example. But it has some very powerful functionality, most notably Text Factories, AppleScript support, Automator Actions, Clippings, and Stationery. I have always found things that BBEdit just does better than other editors: see for example Zap Gremlins or Process Lines Containing or Process Duplicate Lines or Sort Lines. BBEdit has always been good at opening large files too, which is something that other editors can’t really match (maybe because that fancy syntax highlighting requires too much processing power). Note: I haven’t tried BBEdit 10 yet: BBEdit 9 is so good that I haven’t needed to. BBEdit is the fastest at doing the SQL backup find and replace that I mentioned above.
TextMate made a splash a few years back, introducing a bunch of cool features previously unseen in the world of Mac text editors. TextMate, for many programmers at least, dethroned BBEdit as our editor of choice: support for snippets, triggers, code completion and syntax highlighting made TextMate a compelling reason to switch. But fast-forward to 2014: TextMate is seemingly abandoned, and the preview of TextMate 2 — open-sourced back in August 2012 — is still a preview. TextMate is still a great editor, but it suffers 1from some performance issues and some bugs. There is still some ongoing development but it’s hard to resist the conclusion that the byline ‘The Missing Editor For Mac OS X’ has become a bit ironic! TextMate was consistently slower at the SQL Find and Replace than BBEdit.
I haven’t really used Chocolat enough to know either way, just a 30-day trial a few months back. I like the look of it and it seems to be a TextMate replacement, plus it has a markdown preview, which is great for me since I use markdown for general writing. I’ve heard that performance might be an issue, but that was almost a year ago, so may have been fixed by now.
vim, vi, Emacs
I’d like to hear from anyone using any of these every day for development on the Mac. I use nano for pretty much any editing I do in the Terminal, which I know is kind of lazy. I could probably save some money and get some nerd cred using Emacs. Should I give it a go?
Almost as fast as BBEdit, and has many powerful features: Command Palette, Snippets, Goto Anything (think QuickSilver for project navigation), a good distraction-free mode, column mode, multiple selections, and a great plugin system with lots of available plugins. The edge over BBEdit is in its blazing fast code completion. Sublime Text is slower than BBEdit at the .sql Find and Replace, but is faster than TextMate.
And the winner so far is… Sublime Text
Sublime Text may be the best editor out there right now. The balance of features, flexibility, and speed make it a great all-purpose development tool. I would recommend also keeping a copy of BBEdit on hand for certain unique features (‘Process Lines Containing’).
Final note: Before you pay for any software, I suggest you download trial versions and test them out. Plus you should try using vi for a couple of weeks, just for educational reasons! Leave a comment if you have any suggestions or alternate options.