New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@replit/codemirror-vscode-keymap

Package Overview
Dependencies
Maintainers
24
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@replit/codemirror-vscode-keymap

VSCode keyboard shortcuts for Codemirror 6

6.0.2
latest
Source
npm
Version published
Maintainers
24
Created
Source

CodeMirror VSCode Keymap

Run on Replit badge NPM version badge

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

FAQs

Package last updated on 09 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts