6.0.2 • Published 2 years ago

@replit/codemirror-vscode-keymap v6.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

CodeMirror VSCode Keymap

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:

Usage

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
6.0.1

2 years ago

6.0.2

2 years ago

6.0.0

3 years ago

0.19.5

3 years ago

0.19.6

3 years ago

0.19.7

3 years ago

0.20.0

3 years ago

0.19.4

3 years ago

0.19.3

3 years ago

0.19.2

3 years ago

0.19.1

3 years ago

0.19.0

3 years ago