JavaScript Programming in GNU Emacs With js3-mode

Consider this post a short advertisement.

Recently I came across js3-mode by Thom Blake, a new major mode for writing JavaScript code in GNU Emacs. I was searching for a replacement to js2-mode as I was becoming increasingly unhappy with the way it handled indentation for code on projects. In particular I wanted a mode that did a better job of formatting code in the style commonly seen in Node.js programs, as most of the JavaScript I write these days uses the Node.js platform.

Out-of-the-box Thom Blake’s js3-mode addressed all of my formatting problems with other JavaScript modes. Although I did end up tweaking some behavior, which the mode makes easy. The mode also does a better job of automatically indenting comment blocks, even though it still screws up M-j inside of a /** … */ style comment block; but I need to double-check to make sure my own Emacs configuration is not causing that problem, as I do have some custom behavior tied into indent-new-comment-line.

I’ve become happy with js3-mode so I wanted to recommend it to other JavaScript programmers using Emacs. And if you do not know JavaScript then check out Marijn Haverbeke’s terrific free book “Eloquent JavaScript” one day. It is great learning material.

Advertisements

2 thoughts on “JavaScript Programming in GNU Emacs With js3-mode

Add Your Thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s