The Stack Overflow podcast is back! Listen to an interview with our new CEO.

An improved JavaScript mode for GNU Emacs that emulates many desirable features of IDEs.

You can download it here.


  • Variable (adjustable) indentation
  • Accurate syntax highlighting
  • Highlighting of syntactic errors and many semantic errors
  • Strict-mode warning reporting (such as duplicate var declaration)
  • Smart line-wrapping in comments and strings
  • Typing helpers (e.g. matching quotes/brackets)
  • Code-folding (collapse element as {...})
  • Supports JavaScript 1.5, 1.6 (including E4X), 1.7 and 1.8
  • Customizable colors, or use font-lock defaults
  • Many customization options

Note - this mode is for GNU Emacs, version 22 and higher. It does not support XEmacs.

js2-mode was written by Steve Yegge. You can find more information on js2-mode at the official website:

history | excerpt history