Skip to content

Commit

Permalink
Add a usage section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Dec 30, 2024
1 parent 75aa31c commit f57dcff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
])
]
})
```

0 comments on commit f57dcff

Please sign in to comment.