Review: The 10 best JavaScript editors

Sublime Text, Visual Studio Code, Brackets, and Atom rise to the top, but several others are also worth considering.

1 2 Page 2
Page 2 of 2

With syntax coloring and folding, capable editing functions (including column-mode editing and regular expression support for search and replace), and a certain amount of function completion and parameter hinting, Notepad++ can easily be your primary code editor for JavaScript. However, it’s far from the most fully featured JavaScript editor in terms of being able to generate code, perform operations such as refactoring, and navigate quickly within a large project.

I formerly used Notepad++ extensively when developing JavaScript applications on Windows machines. At the time, I preferred it to Visual Studio 2008 for that purpose. Notepad++ stayed out of my way, which allowed me to concentrate on the code I was trying to build. Later on, its minimalist approach felt less useful to me, and I adopted other tools that reduced the number of keystrokes required to generate code.

Notepad++ is still useful in a pinch, and it’s a free download. If you have a Windows machine or VM, you should have Notepad++ installed, ready when you need it.

Cost: Free, open source.
Platform: Windows only.

BBEdit 

BBEdit 14 (available in $49.99 licensed and free unlicensed versions) is a Mac-only HTML and text editor that supports about 35 programming and markup languages, with community support (of varying quality) for many other languages available through the BBEdit website. Both versions do syntax highlighting; the licensed version also does a certain amount of autocompletion, mostly for function names, variable names, a few keywords, and ctags. The licensed version also integrates with the Git, Perforce, and Subversion version control systems.

BBEdit 11 was a major rewrite of the product, making it even faster than it was before, as well as still being able to handle ginormous files gracefully; BBEdit 12 is a 64-bit version with dark mode support. BBEdit has an extract function that copies a selection or find result into a new buffer, and a clippings function. It can edit and run Perl, Python, Ruby, and Shell scripts, as well as check syntax for Perl and Python scripts.

BBEdit’s support of HTML and Markdown is good—actually better than its JavaScript support. You can install three command-line tools for BBEdit: one for the editor, one for its difference engine, and one for its multifile search.

The free unlicensed version of BBEdit is certainly worth having around on a Mac. It might be worth buying a license if you don’t like our recommended IDEs or editors, or if you want BBEdit’s HTML tools, clippings system, or version control support.

Cost: Free limited unlicensed version; $49.99 per user for full version.
Platforms: macOS only.

TextMate

TextMate was once all the rage among the cool kids who wrote Ruby on Rails on their MacBooks while sitting at tables in college cafés. TextMate has since become less prominent as it fell into neglect and Sublime Text gained popularity. With version 2.0, the product looked ready to make a comeback. It was moribund for several years but is now again in active development.

TextMate is not an IDE, but by using its bundles, snippets, macros, and scoping system, you can often gain features that even a language-specific IDE lacks. TextMate now ships with bundles for plain JavaScript and jQuery, which provide a bunch of nice tools for generating JavaScript and jQuery code quickly. For near-IDE-like functionality you can use TextMate’s shell integration, but don’t expect code refactoring or automatic unit or regression testing. If you set up Grunt correctly, of course, you can automate your JavaScript testing at that level.

Those cool kids building Rails applications with TextMate a decade ago (including DHH, if I remember correctly) did have to use a keystroke (^\) to trigger their test runs. On some other Rails IDEs, they could have run tests automatically on save. These days, they might automatically trigger regression tests on a git push using a Jenkins server.

textmate IDG

TextMate 2.0 is the newly updated code and markup editor for the Mac. TextMate is not an IDE, but its snippets, macros, and scoping system can often provide features that even a language-specific IDE lacks. As seen above, TextMate includes “bundles” for JavaScript and jQuery.

Note that only the most popular bundles actually ship with the product. TextMate has a bundles preference tab from which you can download and install additional bundles simply by checking their boxes. The source for the bundles, and indeed the source for the product, resides in GitHub repositories. When I added bundles for many languages I happen to know, I discovered that adding too many bundles can make the actions menu a bit unwieldy. But once you learn the key mappings for the bundle commands you use the most, the menu size won’t matter.

Markdown support is provided in one of the in-package bundles. It includes a document preview function, a Markdown cheat sheet, and lots of shortcuts for generating Markdown markup.

The Git bundle works well to integrate TextMate with Git and GitHub. TextMate recognized my existing Git repositories without any prompting when I opened them as project directories, and it was able to update them from GitHub using a pull command from the bundle. The SQL bundle lets you work with MySQL and PostgreSQL databases.

As far as speed goes, TextMate is close to Sublime Text. It might be a hair slower, but I’d need a stopwatch to be sure. I certainly can’t complain about it.

Cost: $59 for a single-user license; site, business, and academic licenses available.
Platform: macOS.

Emacs

Emacs and its heirs and variants have been around since the early 1970s at the MIT AI lab, starting as macros for the TECO text editor and becoming a standalone later. Emacs release dates were the object of some humor back in the day. GnuEmacs was the start of the Gnu project; the rather heated disagreements between Richard Stallman (aka rms) and the people who had left the AI lab for Lucid and Symbolics were legendary.

I won’t say “Get off my lawn!” but it was a natural transition for me to switch from TECO to Emacs in the late 1970s, on my VT-52 terminal, and I continued to use variants of Emacs for decades on various computers and operating systems. My friends who still “live” in Emacs often do all their software development there. In the old days, they also read their email and newsgroups there.

The Emacs installed on macOS by default is 22.1.1 and built without GUI support. You can easily install XEmacs, Aquamacs (GUI for macOS), and newer GNU Emacs versions on whatever system you have. If you’re old school, you can build the One True Editor the One True Way: from source. With a little work, you can customize your Emacs (hint: edit your .emacs file with Emacs, and test your elisp code in the buffer before saving it) with packages for almost anything you want, including playing Adventure and Tetris. You’ll want to add Melpa as a package repository.

To the point of Emacs as a JavaScript editor: The default major mode for editing JavaScript is in the js package, but you can get better syntax highlighting and linting with the js2-mode package, and autocompletion with ac-js2. You can get live browser JavaScript, HTML, and CSS interaction with skewer-mode. Of course, there are packages for Git, Subversion, and other ALMs.

If you really want to get weird, try the Emacs packages that give you Vi or WordStar emulation. If this sounds too complex, you may not even want to deal with Emacs key combinations. Ctrl-x Ctrl-c will get you out.

A completely pimped-out Emacs installation is a thing of beauty. For true retro joy (when you get tired of JavaScript), install a Common Lisp (for example, SBCL) and SLIME mode, and hack like someone from the MIT AI Lab.

Cost: Free, open source.
Platforms: Windows, macOS, Linux.

Vim (and variants)

Vi (visual interface) was originally written by Bill Joy for Unix, starting in 1976, as an evolution from Ed via Ex (an enhanced version of Ed). Vim is a free, open source, improved version of Vi; the version installed on Mac OS X by default is 7.3. The most important thing to know about Vi before you try it is how to exit: <Esc>:q<Enter>.

You can easily install a newer version of Vim, MacVim (the GUI for macOS), or whatever is available for your platform. With more work, you can install a plugin manager (I use vim-plug), edit your .vimrc file to specify plugins, and install the plugins (:PlugInstall if using vim-plug). Does this sound a lot like Emacs? Just wait. If you’re old school, you can build Vim from source; you’ll find instructions at the Vim project site.

To the point of Vim as JavaScript editor: The suggestions in the vim-plug readme file are pretty good, and if you search the web for “vim javascript syntax” you’ll get several conflicting suggestions. Vi users, like Emacs users, are nothing if not opinionated. On the other hand, most of the suggestions you’ll find are pretty good, and a completely pimped out Vim installation is a pleasure to use, if not quite a thing of beauty. (But consider the source, as I used Emacs for almost a decade before having to launch Vi on a system that didn’t have Emacs installed, and when I did, I struggled to discover <Esc>:q<Enter>.)

Cost: Free, open source. 
Platforms: Windows, macOS, Linux.

Choosing a JavaScript editor

Whether you specialize in client-side JavaScript or Node.js, you have a number of options. If you’re looking for a powerful, blazing-fast programming text editor for JavaScript and a lot of other languages and you don’t mind shelling out $70, Sublime Text is likely to make you happy. If you want a free, fast JavaScript editor that doubles as an IDE and does a great job with ASP.Net and C#, look no further than Visual Studio Code.

Brackets and Atom are two fairly new, free programming text editors you might like. Brackets is very close to being able to function as an IDE for Node.js development, and Atom is tightly integrated with the GitHub desktop clients.

On Windows, Notepad++ is fast, useful, and free. On macOS, BBEdit is fast, useful, free in a limited edition, and it's available with version control integration, HTML tools, and other extras for a modest price. TextMate is still a terrific editor—fast, full featured, and extensible—but development has slowed to a crawl. At this point I’d recommend BBEdit over TextMate for Mac users.

If you’re old school and not afraid of rolling up your sleeves to customize your editor, you might find Emacs or Vim to your liking—and be able to turn them into IDEs or something close.

At a Glance

Copyright © 2022 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2
How to choose a low-code development platform