My experience with CodeMirror
1. The context
In the past, I have been using in MODx Evolution the plugins for the EditArea and GeSHi text highlighting editors.
EditArea is easy to install on Evo.
I appreciated its search feature.
One reason I stopped using EditArea was it slowered the rendering of the ressources in the manager.
Two reasons lead me giving a try to CodeMirror:
First, I was looking for some plugin having code folding feature, like Firefox DOM editor does have:
http://codemirror.net/demo/folding.html
Second, I hoped that CodeMirror would be faster to load/render than EditArea, and the good new is that it is.
2. The installation
I encountered several quirks during installation on Evo 1.0.15 running on PHP 5.6.15 but got it working at the end.
First I downloaded the plugin from its repository on GitHub:
https://github.com/hansek/MODX-Evolution-CodeMirror
After opening the archive, I copied the content of codemirror folder in assets/plugins to the matching location in Evo.
Copied the "install" folder at the root of my website and run the installer.
The installer was able to create the plugin and set the event handlers.
However it displayed some error related to the DBAPI.
The fact is that the installer is still using mysql_connect, which is obsolete with PHP >= 5.5.
(mysqli_connect should be used instead)
After installation, Evo's manager login screen was no longer working and displaying some error related to the obsolete mysql_connect function.
So, I edited "manager/includes/config.inc.php" to force MODx using mysqli:
$database_type = 'mysqli';
This restored the access to the manager.
However, the CodeMirror code highlighter was still not working because the "cm" subfolder in assets/plugins/codemirror was empty.
I downloaded the archive of CodeMirror 2.25 from the top message in this thread, which does have a non-empty "cm" folder:
https://forums.modx.com/attachment/download?file=8114
I dragged and dropped its content in assets/plugins/codemirror/cm.
CodeMirror now highlights contents correctly (including the template variables used in YAMS) and is fast.
3. Bug / Not working
I observe that if the content is higher than the textarea,
the lift/elevator is stuck at the top of that area.
I tried replacing the content of the "cm" folder with the latest (5.34.0) version of CodeMirror but this had no effect.
4. Additional notes
The folding feature is inactive with the default configuration.
There is no "search" feature with the default configuration.