You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vimee is a framework-agnostic, pure-function Vim engine that you can plug into any editor UI. The core engine has zero runtime dependencies β it takes a keystroke and returns state transitions. Framework bindings (React, etc.) are thin wrappers that turn those transitions into reactive state.
import{attach}from"@vimee/plugin-monaco";// Assumes `editor` is a monaco.editor.IStandaloneCodeEditor instanceconstvim=attach(editor,{onChange: (value)=>console.log("Changed:",value),onModeChange: (mode)=>console.log("Mode:",mode),});// Later...vim.destroy();
import{TextBuffer,createInitialContext,processKeystroke,}from"@vimee/core";constbuffer=newTextBuffer("Hello, world!");letctx=createInitialContext({line: 0,col: 0});// Type "dd" to delete a lineconstr1=processKeystroke("d",ctx,buffer);ctx=r1.newCtx;constr2=processKeystroke("d",ctx,buffer);ctx=r2.newCtx;console.log(buffer.getContent());// ""
The engine is a pure function β no side effects, no DOM, no framework dependency. All state transitions are explicit and testable. The VimAction[] array tells the UI layer what happened (cursor moved, content changed, mode switched, etc.).
All motions, operators, and editing commands support count prefixes (e.g. 3dd, 5j, 2dw).
Development
# Install
bun install
# Build all packages
bun run build
# Run all tests
bun run test# Type check
bun run typecheck
# Lint
bun run lint
# Generate a changeset
bun run changeset:gen # auto-detect from commits
bun run changeset:gen major # force major bump
Debug App
A debug app is included for local development and E2E testing. It provides a minimal page for each plugin.
# Start the debug app dev server
bun run debug
The debug app uses workspace:* to reference local packages, so any changes you build in packages/* are reflected immediately.
Monorepo Structure
packages/
βββ core/ # @vimee/core β headless vim engine
βββ react/ # @vimee/react β React useVim hook
βββ plugin-textarea/ # @vimee/plugin-textarea β vim for any textarea
βββ plugin-monaco/ # @vimee/plugin-monaco β vim for any Monaco Editor
βββ plugin-codemirror/ # @vimee/plugin-codemirror β vim for any CodeMirror 6 editor
βββ shiki-editor/ # @vimee/shiki-editor β editor component with Shiki
βββ testkit/ # @vimee/testkit β test utilities for Vim operations
debug/ # Debug app for local development (Vite MPA)
e2e/ # Playwright E2E tests
Built with Bun workspaces, tsup for bundling, and Vitest for testing.