Difference between revisions of "Js2-mode"

From WikEmacs
Jump to navigation Jump to search
(added basic js2-mode page)
 
((minor))
 
(5 intermediate revisions by 3 users not shown)
Line 10: Line 10:
  
 
'''js2-mode''' provides Emacs font-lock, indentation, and navigation for the [[JavaScript]] programming language. It also features an advanced JavaScript parser.
 
'''js2-mode''' provides Emacs font-lock, indentation, and navigation for the [[JavaScript]] programming language. It also features an advanced JavaScript parser.
 +
 +
The original repository (at Google Code) seems to be outdated and https://github.com/mooz/js2-mode#readme seems to be a maintained fork.  It includes [https://github.com/mooz/js2-mode/wiki/Changes-from-the-original-mode several changes].
  
 
== Basic setup ==
 
== Basic setup ==
Line 18: Line 20:
 
</source>
 
</source>
  
== Helpful keybindings ==
+
== Features ==
 +
 
 +
* accurate '''syntax highlighting''' using a recursive-descent parser
 +
* on-the-fly reporting of '''syntax errors''' and strict-mode warnings
 +
* undeclared-variable warnings using a configurable externs framework
 +
* "bouncing" line indentation to choose among alternate indentation points
 +
* '''smart line-wrapping''' within comments and strings
 +
* '''code folding''':
 +
** show some or all function bodies as {...}
 +
** show some or all block comments as /*...*/
 +
* context-sensitive '''menu bar''' and popup menus
 +
* code browsing using the [[Imenu]] package
 +
* many customization options
 +
* strict recognition of the Ecma-262 language standard
 +
* support for most Rhino and SpiderMonkey extensions from 1.5 and up
 +
* parsing support for ECMAScript for XML (E4X, ECMA-357)
  
 
== Common Customization ==
 
== Common Customization ==
  
 
== See Also ==
 
== See Also ==
 +
* [https://github.com/magnars/js2-refactor.el js2-refactor] - A refactoring library based on js2-mode.
 +
* [[Swank-js]] ([https://github.com/swank-js/swank-js homepage]) - A REPL to interact with the browser.
  
 
== Tutorial Pages ==
 
== Tutorial Pages ==
  
[[Category:Programming]][[Category:Third-Party Package]]
+
[[Category:JavaScript]]
 +
[[Category:Programming]]
 +
[[Category:Third Party Package]]

Latest revision as of 21:20, 12 June 2017

js2-mode
Description major mode for JavaScript programming
Author Steve Yegge
Maintainer FSF
Source http://bzr.savannah.gnu.org/lh/emacs/elpa/annotate/head:/packages/js2-mode/js2-mode.el
Part of Emacs no

js2-mode provides Emacs font-lock, indentation, and navigation for the JavaScript programming language. It also features an advanced JavaScript parser.

The original repository (at Google Code) seems to be outdated and https://github.com/mooz/js2-mode#readme seems to be a maintained fork. It includes several changes.

Basic setup

(package-install "js2-mode")
(require 'js2-mode)

Features

  • accurate syntax highlighting using a recursive-descent parser
  • on-the-fly reporting of syntax errors and strict-mode warnings
  • undeclared-variable warnings using a configurable externs framework
  • "bouncing" line indentation to choose among alternate indentation points
  • smart line-wrapping within comments and strings
  • code folding:
    • show some or all function bodies as {...}
    • show some or all block comments as /*...*/
  • context-sensitive menu bar and popup menus
  • code browsing using the Imenu package
  • many customization options
  • strict recognition of the Ecma-262 language standard
  • support for most Rhino and SpiderMonkey extensions from 1.5 and up
  • parsing support for ECMAScript for XML (E4X, ECMA-357)

Common Customization

See Also

Tutorial Pages