CodeMirror
CodeMirror is a JavaScript component that provides a code editor in the browser. It has a rich programming API and a focus on extensibility.
Developer(s) | Marijn Haverbeke |
---|---|
Stable release | 5.59.2
/ January 20, 2021[1] |
Repository | |
Written in | JavaScript |
Platform | Web |
Type | Source code editor |
License | MIT |
Website | codemirror |
History
The first version of the editor was written early 2007, for the console in the Eloquent JavaScript website. The code was first packaged up and released under the name CodeMirror in May 2007. This version was based on the contentEditable
feature of browsers.[2]
In late 2010, the Ace project, another JavaScript-based code editor, pioneered new implementation techniques and demonstrated that it is possible, even in JavaScript, to handle documents with many thousands of lines without degraded performance. This prompted a rewrite of CodeMirror [3] along the same principles. The result was version 2, which no longer relied on contentEditable
and significantly improved performance.
Features
- Multicursors
- Syntax highlighting
- Syntax verification
- Brace matching
- Auto indentation and outdent
- Autocompletion
- Code/text folding
- Search and Replace
- Handles huge documents (hundreds of thousands of lines) without trouble.
- Customizable key bindings including Vi and Emacs modes.
- A wide range of language modes.[4]
- Add-ons for autocompletion, code folding, integrated linting.
- A broad programming API.
- Support for some mobile operating systems
Projects using CodeMirror
- Brackets (code editor)
- Codeanywhere
- Codenvy
- Gerrit Code Review
- Google Chrome DevTools
- Jupyter Notebook
- Light Table (experimental IDE)
- Mozilla Firefox web console
- uBlock Origin
- SWISH (Web-based Prolog IDE)