Skip to main content

Package installation

Install the @replit/codemirror-vim package using your preferred package manager:
npm i @replit/codemirror-vim

Peer dependencies

CodeMirror Vim requires several CodeMirror 6 packages to function. These are listed as peer dependencies and must be installed separately if you don’t already have them in your project.

Required packages

The following CodeMirror 6 packages (version 6.x.x) are required:
  • @codemirror/commands - Core editor commands
  • @codemirror/language - Language support infrastructure
  • @codemirror/search - Search and replace functionality
  • @codemirror/state - Editor state management
  • @codemirror/view - Editor view layer

Installing peer dependencies

If you’re starting a new CodeMirror project, you can install all required dependencies at once:
npm i @replit/codemirror-vim @codemirror/commands @codemirror/language @codemirror/search @codemirror/state @codemirror/view codemirror
The codemirror package includes basicSetup and other useful utilities for quickly setting up an editor. While not strictly required, it’s recommended for most projects.

Version compatibility

CodeMirror Vim is designed to work with CodeMirror 6. All peer dependencies should be version 6.x.x to ensure compatibility.
CodeMirror Vim is not compatible with CodeMirror 5. If you’re upgrading from CodeMirror 5, you’ll need to migrate your entire editor setup to CodeMirror 6.

Verify installation

Once installed, you can verify the package is available by importing it in your code:
import { vim } from "@replit/codemirror-vim";

console.log(vim); // Should output the vim function

Next steps

Quickstart

Learn how to set up a basic editor with Vim keybindings

Build docs developers (and LLMs) love