Documentation

Codemirror

codemirror

Type: Boolean, Object

Default: false

This setting allows you to connect Codemirror on the page for code highlighting when adding and editing the code block or in the source mode.

RedactorX('#entry', {
    codemirror: true
});

You can set Codemirror settings, like this:

RedactorX('#entry', {
    codemirror: {
        lineNumbers: true
    }
});

See a live example of how Codemirror works with Redactor X.

codemirrorSrc

Type: Object

Default: false

This setting allows you to specify the instance of Codemirror if it is already initialized in your application.

RedactorX('#entry', {
    codemirror: true,
    codemirrorSrc: MyCodemirrorInstance
});