PHPackages                             luwes/craft3-codemirror - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. luwes/craft3-codemirror

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

luwes/craft3-codemirror
=======================

Add the awesome in-browser code editor CodeMirror as a field type.

2.0.0(3y ago)1753.9k↓51.1%10[11 issues](https://github.com/luwes/craft-codemirror/issues)MITJavaScriptPHP ^8.0

Since Nov 26Pushed 3y ago3 watchersCompare

[ Source](https://github.com/luwes/craft-codemirror)[ Packagist](https://packagist.org/packages/luwes/craft3-codemirror)[ RSS](/packages/luwes-craft3-codemirror/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (7)Used By (0)

CodeMirror plugin for Craft CMS
===============================

[](#codemirror-plugin-for-craft-cms)

Add the awesome in-browser code editor CodeMirror as a field type.

[![Screenshot](resources/img/codemirror-screenshot.png)](resources/img/codemirror-screenshot.png)

Installation
------------

[](#installation)

To install CodeMirror, follow these steps:

1. Install with Composer via `composer require luwes/craft-codemirror`
2. Install plugin in the Craft Control Panel under Settings &gt; Plugins

CodeMirror works on Craft 3.x and 4.x.

CodeMirror Overview
-------------------

[](#codemirror-overview)

Configuring CodeMirror
----------------------

[](#configuring-codemirror)

Copy the code below, create a file named `code-mirror.php` and place it in the craft config folder to override the default options.

```
return [
    'jsOptions' => [
        'theme' => 'default',
        'lineNumbers' => true,
        'lineWrapping' => true,
        'viewportMargin' => new JsExpression('Infinity'),
    ],
    'modes' => [
        'gfm', // the first mode is enabled by default
        'markdown',
        'htmlmixed',
        'javascript',
        'css',
        'xml',
    ],
    'addons' => [
        'mode/overlay', // needed for gfm (github flavored) mode
    ]
];
```

Brought to you by [Wesley Luyten](https://wesleyluyten.com)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~352 days

Recently: every ~343 days

Total

6

Last Release

1378d ago

Major Versions

1.0.2 → 2.0.02022-08-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb265b8c67e122173ba16b6ba98a4ccf2e92d0c9ef0f7a361b6aed57a799c428?d=identicon)[luwes](/maintainers/luwes)

---

Top Contributors

[![luwes](https://avatars.githubusercontent.com/u/360826?v=4)](https://github.com/luwes "luwes (5 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (1 commits)")[![DominicVonk](https://avatars.githubusercontent.com/u/3958086?v=4)](https://github.com/DominicVonk "DominicVonk (1 commits)")[![jeffturcotte](https://avatars.githubusercontent.com/u/65089?v=4)](https://github.com/jeffturcotte "jeffturcotte (1 commits)")[![khamer](https://avatars.githubusercontent.com/u/1452?v=4)](https://github.com/khamer "khamer (1 commits)")[![MakeilaLundy](https://avatars.githubusercontent.com/u/19892516?v=4)](https://github.com/MakeilaLundy "MakeilaLundy (1 commits)")

---

Tags

codemirrorcraft-plugincraftcmsfieldtypecmsCraftcraftcmscraft-plugincodemirror

### Embed Badge

![Health badge](/badges/luwes-craft3-codemirror/health.svg)

```
[![Health](https://phpackages.com/badges/luwes-craft3-codemirror/health.svg)](https://phpackages.com/packages/luwes-craft3-codemirror)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[verbb/navigation

Create navigation menus for your site.

92705.0k18](/packages/verbb-navigation)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/workflow

Enforce multi-step review processes for creating entries.

138124.2k1](/packages/verbb-workflow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
