codemirror-addon-indent-guide

1.0.1 • Public • Published

codemirror-addon-indent-guide

Codemirror addon to include indentation guidelines.

How to use

  1. Install the library from npm
npm i codemirror-addon-indent-guide
  1. Import the module addon after importing codemirror module
import 'codemirror-addon-indent-guide';
  1. Setup indentGuide and indentUnit options when initializing codemirror editor. Example:
CodeMirror.fromTextArea(elem, {
  indentUnit: 2,
  indentGuide: true,
});
  1. Style it with some css using the classname cm-indent-guide. Example:
.cm-indent-guide {
  position: relative;
  border-left: 1px dotted #bbb;
}

Package Sidebar

Install

npm i codemirror-addon-indent-guide

Weekly Downloads

91

Version

1.0.1

License

MIT

Unpacked Size

12.4 kB

Total Files

12

Last publish

Collaborators

  • assisrafael