1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00
TiddlyWiki5/plugins/tiddlywiki/codemirror
Jermolene 3842657392 Add/update plugin readmes
Notice that translators need to translate the core plugin readme
2014-08-07 15:49:52 +01:00
..
lib Upgrade codemirror to current master 2014-05-06 23:30:40 +02:00
edit-codemirror.js Refactor codemirror plugin 2014-06-18 13:54:19 +01:00
EditorTypeMappings.multids Refactor codemirror plugin 2014-06-18 13:54:19 +01:00
plugin.info Add/update plugin readmes 2014-08-07 15:49:52 +01:00
readme.tid Add/update plugin readmes 2014-08-07 15:49:52 +01:00
styles.tid Improve readability of CodeMirror editor 2013-11-09 15:56:17 +00:00

title: $:/plugins/tiddlywiki/codemirror/readme

! Setting ~CodeMirror Content Types

You can determine which tiddler content types are edited by the ~CodeMirror widget by creating or modifying special tiddlers whose prefix is comprised of the string `$:/config/EditorTypeMappings/` concatenated with the content type. The text of that tiddler gives the editor type to be used (eg, ''text'', ''bitmap'', ''codemirror'').

The current editor type mappings are shown in [[$:/ControlPanel]] under the "Advanced" tab.

! ~CodeMirror Configuration

You can configure the ~CodeMirror plugin by creating a tiddler called [[$:/config/CodeMirror]] containing a JSON configuration object. The configuration tiddler must have its type field set to `application/json` to take effect.

See http://codemirror.net/ for details of available configuration options.

For example:

```
{
  "require": [
      "$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js",
      "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js",
      "$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js",
      "$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js",
      "$:/plugins/tiddlywiki/codemirror/keymap/vim.js",
      "$:/plugins/tiddlywiki/codemirror/keymap/emacs.js"
  ],
  "configuration": {
      "keyMap": "vim",
      "matchBrackets":true,
      "showCursorWhenSelecting": true
  }
}
```