CodeMirror-Talk

Summary: Talk page for CodeMirror.
Maintainer: Dfaure (helped by Simon)
Users: +5 (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.


A brilliant plugin. Now, if only I can get vim mode working. This Codemirror page refers: Vim demo. I have not yet viewed this plugin code, but is possible that Vim support might require higher level changes than on a parameters level as attempted below, refer to https://stackoverflow.com/questions/15152675/using-codemirror-in-vim-mode#15184747

Using Codemirror-5.34.0, I have tried adding each of the following options respectively in /local/config.php before the include_once line to load CodeMirror. In each case CodeMirror does work, but vim mode is not enabled though.

  • $CodeMirrorActivePreset['keyMap'] = 'vim';
  • $CodeMirrorPresets['keyMap'] = "vim";
  • $CodeMirrorPresetParams['keyMap'] = 'vim';
  • $CodeMirrorConfig['keyMap'] = "vim";

Any help will be appreciated, thanks. casperl February 05, 2018, at 03:56 AM

Thanks for the comment. In fact, I didn't enable any editor's custom keymap (and related scripts) in the previous recipe version. This has been fixed for now and you could enable it with:
$CodeMirrorActivePresets['vim'] = 1;
Dfaure February 06, 2018, at 05:07 AM

To increase the height of the editing area add the line

.CodeMirror { height: 30em; } /* added */

to pub/css/local.css

To change the font size in the editing area add the line

.CodeMirror { font-size: 0.95em; } /* added */

to pub/css/local.css


Recipes like EditPosFix or RememberEditPosition do not work after installing this receipe. Some function of that kind would be great, allthough. Is there anyone, who can implement this? svasta, 2016-11-30

The feature is available in latest release.
Dfaure March 22, 2017, at 09:43 AM
Works fine! Thank you very much!!! These "little" things are saving so much time... svasta, 2017-04-11

GuiEditResize recipe does not work when this recipe is enabled

simon March 28, 2015, at 10:17 PM

I've had a coworker complain about losing spell checking when this awesome editor is installed. I've attempted to shoe horn in a couple of the suggested fixes (html span assignment or outside javascript) from CM's github discussions but haven't had any luck. Any advice ?

unfy Aug 4, 2015
You may use the highlight/regular editing checkbox feature in the icons bar to get back to the standard editor which handle spell checking.
Dfaure May 26, 2016, at 02:38 AM

Any trick to make it work nicely on mobile? Utopiah June 20, 2016, at 10:10 AM

For CodeMirror itself, you may refer to: http://codemirror.net/#browsersupport. For the PmWiki side, this should rely on a mobile-compatible skin.
Dfaure August 09, 2016, at 04:41 AM

How do I change the theme? I know I'm probably missing something simple, but I'm not at a loss. -Monte, 2017-08-18

  • I tried replacing pmwiki.css with night.css, but it didn't work. Do I need to update the pmwiki.css file, since it has cm-pm-* -vs- cm-s-* tagging? -Monte, 2017-08-18
Sorry but themes haven't been handled for now. May be in a future version...
Dfaure August 18, 2017, at 02:10 PM

Talk page for the CodeMirror recipe (users).