]> code.delx.au - gnu-emacs-elpa/blob - README.md
Readme updates.
[gnu-emacs-elpa] / README.md
1 # Context Coloring
2
3 <p align="center">
4 <img alt="Screenshot of JavaScript code highlighted by context." src="screenshot.png" title="Screenshot">
5 </p>
6
7 Highlights JavaScript code according to function context. Code in the global
8 scope is white. Code in functions within the global scope is yellow, and code
9 within such functions is green, etc. Identifiers retain the color of the scope
10 in which they were defined. Comments are gray.
11
12 This coloring scheme is probably more useful than conventional JavaScript
13 *syntax* highlighting. Lexical scope information at-a-glance is probably more
14 useful than detecting if you spelled "function" wrong, or determing that you
15 forgot to close a string literal. (A [linter][] would serve you better in that
16 regard.)
17
18 ## Usage
19
20 Requires Emacs 24+ and [Node.js 0.10+][node].
21
22 - Clone this repository.
23 - Run `npm install --production` in it.
24 - Add it to your [load path][].
25 - Add the following to your `~/.emacs`:
26
27 ```lisp
28 (require 'context-coloring)
29 (add-hook 'js-mode-hook 'context-coloring-mode)
30 ```
31
32 [linter]: https://github.com/jacksonrayhamilton/jslinted
33 [node]: http://nodejs.org/download/
34 [load path]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html