ABAP mode for CodeMirror
npm install codemirror-abap
ABAP mode for the CodeMirror editor
bash
npm install --save codemirror-abap
`
Usage
$3
1. Import codemirror-abap in your project.
`js
import CodeMirror from 'codemirror';
// mode and MIME type are registered automatically
import 'codemirror-abap';
`
or
`js
import CodeMirror from 'codemirror';
import { abapMode } from 'codemirror-abap';
// explicitly register mode
CodeMirror.defineMode("abap", abapMode);
`
2. Set 'abap' as the mode when instantiating the CodeMirror editor.
`js
CodeMirror.fromTextArea(element, {
mode: 'abap'
});
`
$3
1. Include the codemirror-abap bundle in a script tag.
`html
`
or
`html
CodeMirror.defineMode("abap", abap.abapMode);
`
2. Set 'abap' as the mode when instantiating the CodeMirror editor.
`js
CodeMirror.fromTextArea(element, {
mode: 'abap'
});
`
$3
`html
`
Demo
There's a simple React demo using react-codemirror2 in the demo directory of the git repo.
To run the demo:
`bash
git clone https://github.com/larshp/codemirror-abap.git
cd codemirror-abap/demo
npm install
npm start
``