js2’s indentation is more like python-mode’s indentation than cc-mode. It isn’t customizable, which hasn’t so far come up as a problem for me, but if you have very strict code style guidelines you may have to do some indenting manually. It provides several options for cycling through possible indentations, and one of them is usually right. Still, it can be somewhat irritating that it doesn’t just indent correctly all the time.
js2 does a few other things that are quite nice. Pressing enter inside a string will extend it to the next line, which is pretty much always what I want to do. I haven’t used it very much - I’ve mostly just been doing very like editing with it - but it is very customizable through the customize mechanism. It also supports hiding of blocks, which I don’t tend to use, but to each their own.
js2-mode is going to be built-in to GNU Emacs 23.2, but if you don’t want to wait until then to use it you have to download and enable it yourself. To enable js2-mode in your emacs, first you must download and byte-compile js2.el from here. If you don’t byte-compile the file, you’ll have to set js2-mode-must-byte-compile to nil in order for it to work at all, but byte compiling the file will make it work much faster. Once that is done, put the following lines in your initialization file to start js2-mode for all .js files:
(autoload 'js2-mode "js2" nil t) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))