Skip to content

Guide

This guide covers the core concepts behind Kodemirror, a Kotlin Multiplatform port of CodeMirror 6.

  • Getting Started — Step-by-step tutorial for creating your first Kodemirror editor
  • Architecture — Module structure, dependency layers, platform targets, and how the design differs from upstream CodeMirror
  • Data Model — Documents, changes, selections, facets, transactions, and editor state
  • The View — The Compose rendering layer, theming, panels, tooltips, gutters, and input handling
  • Extending — State fields, view plugins, facets, compartments, decorations, and precedence
  • Extension Index — Which module provides each common extension
  • Migrating from CodeMirror 6 — Porting patterns, module mapping, and key API differences for JS developers
  • Extension Architecture — When to use StateField vs Facet vs ViewPlugin, ordering, and composition
  • Collaborative Editing — Real-time collaboration with operational transformation
  • Merge and Diff Views — Side-by-side and unified diff views for comparing documents
  • Performance — Virtualization, decorations, parser performance, and large document tips
  • Testing — Patterns for testing commands, state fields, completions, and linters
  • Language Module Guide — How to create a :lang-* module for a new language
  • Troubleshooting — Common issues and solutions

See also the API Reference for generated KDoc documentation of every module.