PHPackages                             luwes/craft-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. luwes/craft-codemirror

ActiveCraft-plugin

luwes/craft-codemirror
======================

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

2.0.0(3y ago)189.8k↑16.7%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/craft-codemirror)[ RSS](/packages/luwes-craft-codemirror/feed)WikiDiscussions master Synced 1mo 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 83% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity34

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

1332d 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-craft-codemirror/health.svg)

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

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[luwes/craft3-codemirror

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

1853.7k](/packages/luwes-craft3-codemirror)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)

PHPackages © 2026

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