# @replit/codemirror-vscode-keymap

> VSCode keyboard shortcuts for Codemirror 6

Latest version **6.0.2** (published 2023-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @replit/codemirror-vscode-keymap
pnpm add @replit/codemirror-vscode-keymap
yarn add @replit/codemirror-vscode-keymap
bun add @replit/codemirror-vscode-keymap
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.2 |
| Published | 2023-01-09 |
| First published | 2022-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Faris Masad |
| Maintainers | bradymaddenreplit, ryantm, alan_at_replit, alexisreplit, ink404, brianpool, tobyho, brenoafb, xiaoyiatreplit, giuseppeatreplit, masad-frost, lincolnreplit, stkenned, jnnnthnn-at-replit, replitmatt, cbrewster, wadeatreplit, ltazmin_replit, jeremypress, moudy, schestakov, lhchavez, slmjkdbtl, lunaroyster |

## Links

- npm: https://www.npmjs.com/package/@replit/codemirror-vscode-keymap
- Repository: https://github.com/replit/codemirror-vscode-keymap
- Homepage: https://github.com/replit/codemirror-vscode-keymap#readme
- Issues: https://github.com/replit/codemirror-vscode-keymap/issues
- npm.io page: https://npm.io/package/@replit/codemirror-vscode-keymap

## Recent versions

- 6.0.2 (latest) — 2023-01-09
- 6.0.1 — 2022-12-16
- 6.0.0 — 2022-06-23
- 0.20.0 — 2022-04-22
- 0.19.7 — 2022-03-30
- 0.19.6 — 2022-03-30
- 0.19.5 — 2022-03-30
- 0.19.4 — 2022-03-07
- 0.19.3 — 2022-01-26
- 0.19.2 — 2022-01-08
- 0.19.1 — 2022-01-08
- 0.19.0 — 2022-01-05

## README

# CodeMirror VSCode Keymap

<span><a href="https://replit.com/@util/CodeMirror-VSCode-Keymap" title="Run on Replit badge"><img src="https://replit.com/badge/github/replit/codemirror-indentation-markers" alt="Run on Replit badge" /></a></span>
<span><a href="https://www.npmjs.com/package/@replit/codemirror-vscode-keymap" title="NPM version badge"><img src="https://img.shields.io/npm/v/@replit/codemirror-vscode-keymap?color=blue" alt="NPM version badge" /></a></span>

Ports VSCode's keyboard shortcuts to CodeMirror 6.

This keymap includes shortcuts for all the official extension and replaces codemirror default keymaps:
- autocomplete (make sure to set `defaultKeymap: false` when enabling this plugin)
- closebrackets
- commands
- comment
- fold
- history
- lint
- search

The keymap is based on the following:
- [Windows](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf)
- [Mac](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf)
- [Linux](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf)

### Usage
```ts
import { EditorView, keymap } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { vscodeKeymap } from "@replit/codemirror-vscode-keymap";

const doc = `
function wow() {
  function hello() {
    console.log({
      lol: 1
    })
  }
}
`

new EditorView({
  state: EditorState.create({
    doc,
    extensions: [keymap.of(vscodeKeymap), javascript()],
  }),
  parent: document.querySelector('#editor'),
});
```

### Missing features
- Scroll Line Down	Ctrl+Down
- Scroll Line Up	Ctrl+Up
- Scroll Page Down	Alt+PageDown
- Scroll Page Up	Alt+PageUp

---
_Source: https://npm.io/package/@replit/codemirror-vscode-keymap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
