diff --git a/README.md b/README.md index 296083c..ecce387 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,20 @@ We aim to be an inclusive, welcoming community. To make that explicit, we have a [code of conduct](http://contributor-covenant.org/version/1/1/0/) that applies to communication around the project. + +## Usage + +```javascript +import {EditorView, keymap} from "@codemirror/view" +import {standardKeymap, selectLine} from "@codemirror/commands" + +const view = new EditorView({ + parent: document.body, + extensions: [ + keymap.of([ + ...standardKeymap, + {key: "Alt-l", mac: "Ctrl-l", run: selectLine} + ]) + ] +}) +``` \ No newline at end of file