GithubHelp home page GithubHelp logo

crismcn / codemirror-vscode-keymap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from replit/codemirror-vscode-keymap

0.0 0.0 0.0 200 KB

VSCode keyboard shortcuts for CodeMirror 6

Home Page: https://replit.com/@util/CodeMirror-VSCode-Keymap

JavaScript 0.91% TypeScript 95.10% Nix 1.17% HTML 2.82%

codemirror-vscode-keymap's Introduction

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

codemirror-vscode-keymap's People

Contributors

masad-frost avatar sergeichestakov avatar alanvf avatar lunaroyster avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.