Skip to content

joel-porquet/CodeMirror-markdown-list-autoindent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeMirror-markdown-list-autoindent

This package is essentially a patch to CodeMirror that adds support for list auto-indentation in Markdown.

When continuing a list in Markdown, type <Tab> to indent the next bullet or <Shift-Tab> to unindent it.

Example:

Screencast

NPM

The package is on NPM:

$ npm install codemirror-markdown-list-autoindent

Usage

When including CodeMirror in your JS client, add the new indentlist.js file:

<link rel="stylesheet" href="(path_to_code_mirror)/lib/codemirror.css">
<script src="(path_to_code_mirror)/lib/codemirror.js"></script>
<script src="(path_to_code_mirror)/addon/edit/continuelist.js"></script>
<script src="(path_to_code_mirror)/addon/edit/indentlist.js"></script>
<script src="(path_to_code_mirror)/mode/markdown.js"></script>

Then bind the <Tab> and <Shift-Tab> keys to the right events:

extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList",
            "Tab": "autoIndentMarkdownList",
            "Shift-Tab": "autoUnindentMarkdownList"}

About

CodeMirror patched with markdown list auto-indent

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published