Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol
diffdown.com
1# @codemirror/commands [](https://www.npmjs.org/package/@codemirror/commands)
2
3[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#commands) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/commands/blob/main/CHANGELOG.md) ]
4
5This package implements a collection of editing commands for the
6[CodeMirror](https://codemirror.net/) code editor.
7
8The [project page](https://codemirror.net/) has more information, a
9number of [examples](https://codemirror.net/examples/) and the
10[documentation](https://codemirror.net/docs/).
11
12This code is released under an
13[MIT license](https://github.com/codemirror/commands/tree/main/LICENSE).
14
15We aim to be an inclusive, welcoming community. To make that explicit,
16we have a [code of
17conduct](http://contributor-covenant.org/version/1/1/0/) that applies
18to communication around the project.
19
20## Usage
21
22```javascript
23import {EditorView, keymap} from "@codemirror/view"
24import {standardKeymap, selectLine} from "@codemirror/commands"
25
26const 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```