What's the Best Text Editor? The One I Use!
All developers have their favorite text/code editor, but is there one, best, magic bullet editor? Well, no. But the good news is there are lots of editors out there with tons of different features, so with a little experimentation, you can find one that fits your needs and preferences. And even if you do have a favorite right now, don’t be afraid to try out others—you might be pleasantly surprised with something new.
The “best editor” depends highly on the project at hand. What do developers look for in an editor? For the most part:
- Availability in preferred OS
- Ability to open/edit remote files (FTP/SFTP)
- Auto completion
- Multi-language (C/C++, Java, Perl, PHP, Ruby, etc...) syntax highlighting support
- Column select
- Powerful regular expression support, macros, scripts, etc...
- Integration with version control systems
- Project organization and easy file navigation (tabbed document interface)
- Multi undo/redo
- Customizable keyboard shortcuts
- Code folding
- File comparison
- Line numbers
Ideally I’d give each editor its own blog post, but since it’d take a pretty long time to cover every single one, for now I’m only going to focus on those that I’ve had a chance to use and can comment on. I encourage you to give each a try, if you haven’t already.
So, without further ado, my list of editors (in the order in which I started using them):
Coming out of UC Berkeley in the 1970s, vi was the first major full-screen unix editor, and vi or one of its clones has been standard on virtually all Unix-like systems since then. One of these clones, vim, is now the version most developers use.
vi is not very intuitive for new users and its modal editing system and cryptic command set can be intimidating, but long-time users swear by it (or at it). The fact that you can’t just start up vi and type away takes some getting used to, but once you get the hang of it you can become very productive with it. Because it’s been around for so long, you can easily find plugins for everything and anything from integrating to a MySQL database to using it together with GitHub.
Very similar to vi in terms of availability, this editor can almost always be found on a Unix-like system, and if it’s not, it can easily be installed for free. Like vi, Emacs has been around a long time and is very powerful, but at the same time it can be intimidating to newcomers. Emacs allows you to customize everything from its functionality (cut, paste, replace, etc...) to its user interface, to the point where it can be used as an IDE to allow a user to edit, compile, debug, and version control code.
Hardcore Unix/Linux developers tend to choose either Emacs or vi and never, ever change.
UltraEdit hit the scene almost 20 years ago and is very rich in features. Like most established software, development for it continues and feature after feature has been added. In my opinion, it’s come to a point where it feels like it’s trying to do anything and everything for everyone, which is not necessarily a good thing. For example, providing the ability to open up and use an SSH session directly on the editor—to me, there are separate tools built specifically for this which do a better job (putty), and I don’t mind changing focus from the editor to my SSH session from time to time.
For a long time, UltraEdit was a Windows-only editor, but in recent years it’s become available for Linux and Mac, too. It’s very inexpensive for its many features, and can be downloaded as demoware so you can take it for a ride first and see how you like it.
EditPlus is very similar to UltraEdit and offers lots of the same features, but in a very lightweight manner—last time I checked, the complete executable was less than 2MB. Also like UltraEdit, EditPlus isn’t free, but it’s inexpensive. The drawback: It’s only available for Windows.
I’ve used Notepad++ the least and only when working on a computer that didn’t haveUltraEdit or EditPlus, since you can download Notepad++ for free.
To me, this editor falls somewhere between UltraEdit and EditPlus. It has many of the features developers look for in an editor,
but still lacks others like column select and remote file editing. (update: combatchuck on reddit points out that you can use NppFTP for remote file editing and alt-click for column select). The look and feel also seem to be a little underdeveloped. Sometimes the editor seems like it’s just what the name states: an enhanced version of Windows Notepad application.
As of this post Sublime Text is the new kid on the block, and it happens to be my favorite editor and the one I use most. It fits somewhere between vi/vim and EditPlus, small in size (between 5 and 7 MB), but very powerful and rich in features.
To me the best thing about Sublime Text is that it looks and feels pretty much the same on every OS (Windows, Mac, or Linux). There are some minor differences in doing certain things like line sorting and search-and-replace. When doing line sorting on a Windows system I need to use F5, but on a MAC I use F9. Also, When doing a search-and-replace, on a Windows system I use Control+H, but on a Mac I need to use Option+Command+F. Again, to me these things are minor and something that can easily be fixed with some custom key bindings.
What are your favorite editors? Any good recs for more that I should try?
Published by TXI in Software Engineering