Skip to content

Commit f57dcff

Browse files
committed
Add a usage section to readme
1 parent 75aa31c commit f57dcff

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,20 @@ We aim to be an inclusive, welcoming community. To make that explicit,
1616
we have a [code of
1717
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
1818
to communication around the project.
19+
20+
## Usage
21+
22+
```javascript
23+
import {EditorView, keymap} from "@codemirror/view"
24+
import {standardKeymap, selectLine} from "@codemirror/commands"
25+
26+
const view = new EditorView({
27+
parent: document.body,
28+
extensions: [
29+
keymap.of([
30+
...standardKeymap,
31+
{key: "Alt-l", mac: "Ctrl-l", run: selectLine}
32+
])
33+
]
34+
})
35+
```

0 commit comments

Comments
 (0)