CodeMirror is a JavaScript component that provides a code editor in the browser. When a mode is available for the language you are coding in, it will color your code, and optionally help with indentation.
The project page is http://codemirror.net The manual is at http://codemirror.net/doc/manual.html