talira

CodeMirror

Extensible code editor component for the web

open sourceMITself-hostablefree

CodeMirror is a code editor component for the web, built from small modules: a state package, a view, and separate packages for languages, autocompletion, search, linting, folding, collaborative editing and merge views. Language support comes from full parsers built with Lezer, CodeMirror's own parser system, with legacy modes for many other languages. It handles accessibility, mobile, bidirectional text and multiple selections, and everything else is added through its extension interface. Version 6 is the current version; CodeMirror 5 is the older, separate release still documented at codemirror.net/5/.

Problems it solves

  • add a code editor with syntax highlighting to my web app instead of a plain textarea
  • let users edit HTML and CSS templates in the browser with autocomplete
  • show lint errors inline while someone types code in my app
  • a code editor that still works properly on phones and with screen readers
  • Monaco is too heavy to load just to edit a small snippet
  • two people editing the same code at once in the browser
  • show a side-by-side diff of two versions of a file in a web page
  • add syntax highlighting for my own template language
  • code folding, bracket matching and search and replace in an embedded editor
  • my textarea code input loses indentation and has no line numbers
  • theme an in-browser editor to match my app's dark mode

Features

  • syntax highlighting
  • line numbers
  • autocompletion
  • code folding
  • search and replace
  • linting
  • bracket closing
  • multiple selections
  • undo history
  • collaborative editing
View 7 more
  • merge view
  • theming
  • accessibility
  • mobile support
  • bidirectional text
  • internationalization
  • language packages for HTML, CSS, Sass, JavaScript, JSON, Markdown and more

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what CodeMirror does.

  1. Ace An embeddable code editor written in JavaScript

Compare CodeMirror with the top 3