codemirror-addon-indent-guide
v1.0.1
Published
Codemirror addon to include indent guidelines
Downloads
363
Readme
codemirror-addon-indent-guide
Codemirror addon to include indentation guidelines.
How to use
- Install the library from npm
npm i codemirror-addon-indent-guide
- Import the module addon after importing codemirror module
import 'codemirror-addon-indent-guide';
- Setup
indentGuide
andindentUnit
options when initializing codemirror editor. Example:
CodeMirror.fromTextArea(elem, {
indentUnit: 2,
indentGuide: true,
});
- Style it with some css using the classname
cm-indent-guide
. Example:
.cm-indent-guide {
position: relative;
border-left: 1px dotted #bbb;
}