Skip to content

vimcraft-labs/vimcraft

Repository files navigation

Vimcraft

License Zig

Neovim-compatible text editor built in Zig with Hermes JavaScript engine. Designed for building AI-powered development tools with TypeScript/JavaScript plugins using JSI zero-copy integration.

⚠️ Early Stage - Developer Preview

Vimcraft is in active development and not ready for general use. This early public release is for hackers and developers who want to experience the project early and contribute to its development.

Expect bugs, incomplete features, and breaking changes. Most functionality is still under active development. Not recommended for production use.

Installation

Requirements: Zig 0.15.2+, Git, C++ compiler (clang++)

git clone git@github.com:vimcraft-labs/vimcraft.git
cd vimcraft
git submodule update --init
zig build
./zig-out/bin/vimc myfile.txt

Configuration

Create ~/.config/vimcraft/init.js with Neovim-compatible API:

vim.opt.cursorLine = true;
vim.opt.number = true;

vim.highlight('Comment', {
  fg: '#6c6c6c',
  italic: true
});

Changes apply instantly with built-in hot reload. See Configuration Guide for the full API.

Architecture

Four-layer design with zero-copy JSI bridge:

User Configuration (init.js)
    ↓↑ JSI (zero-copy)
JavaScript API (vim.*)
    ↓↑ JSI Bridge
Hermes Runtime
    ↓↑ C API
Editor Core (Zig)

JSI (JavaScript Interface): Direct native ↔ JavaScript calls without serialization. Synchronous execution with pointer-based parameters.

Hermes Engine: Ahead-of-time bytecode compilation for fast startup. From React Native.

Zig: Systems language with compile-time safety and C interoperability.

See Architecture Documentation for implementation details.

Project Status

Working:

  • Vim navigation (hjkl, w/b/e, gg/G, 0/$, f/F/t/T)
  • Text editing (insert, delete, change, yank/paste)
  • Visual mode (character, line, block)
  • Registers and clipboard
  • Undo/redo (tree-based)
  • Configuration API (vim.opt, vim.highlight)
  • Hot reload
  • Chrome DevTools debugging (--debug)

In Development:

  • Plugin system (vim.keymap, autocommands)
  • LSP integration
  • Tree-sitter syntax

See Roadmap for details.

Building from Source

# Build
zig build

# Run tests
zig build test

# Format code
zig fmt src/

# Build Hermes (if needed)
cd vendor/hermes && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel -GNinja
ninja hermes hermesc

Documentation

Full documentation: docs/

Contributing

  1. Check issues or roadmap
  2. Read Development Guide
  3. Submit PR following Contributing Guidelines

Good first issues: Look for good-first-issue label.

Project Layout

src/
├── editor/           # Core editor (buffer, cursor, modes)
├── backends/         # Rendering backends (terminal, debug)
├── system/           # System integration (JSI, event loop)
└── tools/            # Development tools

License

MIT License - see LICENSE

Acknowledgments

  • Neovim - API design and architecture
  • Hermes - JavaScript runtime (React Native)
  • Zig - Systems programming language
  • Helix - Terminal rendering patterns
  • Ghostty - Zig best practices

About

AI-Native Terminal Editor Built in Zig

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •