Skip to content

adrianhelvik/ovim

Repository files navigation

ovim — Oxidized Vim

A fast, batteries-included terminal editor with Vim keybindings, built in Rust.

ovim gives you what Neovim distros give you. LSP, tree-sitter highlighting, AI chat, sane defaults.

Ovim - start screen Ovim - fuzzy finder

What You Get Out of the Box

  • 35+ languages with tree-sitter syntax highlighting, compiled in
  • LSP auto-install — open a file, the language server downloads and starts
  • AI chat and editingSpace Space to chat, visual select + Space to edit
  • Vim keybindings — operators + motions, text objects, visual mode, macros, marks, registers
  • Lua configvim.opt.number = true just works. Configure when you want to, not because you have to.
  • Headless mode — run without a terminal, control via REST API

Quick Start

cargo build --release

# Open a file
./target/release/ovim file.rs

# Jump to a specific line and column
./target/release/ovim src/main.rs:42:10

LSP starts automatically. Syntax highlighting works. No setup needed.

The rest of this README uses ovim assuming the binary is on your PATH.

Language Support

22 languages with LSP auto-install, 2 more with manual LSP setup, plus syntax-only languages.

When you open a file and its language server isn't installed, ovim asks once:

  • Enter — install now
  • A — always auto-install
  • Esc — skip
Languages LSP Server
Rust rust-analyzer
TypeScript / JavaScript typescript-language-server
Python pyright
Go gopls
Java, Kotlin, Scala, Groovy hyperion-lsp
C# csharp-ls
C / C++ clangd (manual install)
Ruby solargraph
Zig zls
Lua lua-language-server
Elixir elixir-ls
Terraform terraform-ls
Bash, SQL, JSON, YAML, HTML, CSS, TOML various
Markdown, HCL syntax highlighting only

Run ovim lsp languages for the full list. See Language Support for details.

Configuration

Configuration is optional. Create ~/.config/ovim/init.lua when you're ready to customize:

vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.scrolloff = 10

-- AI (requires OPENAI_API_KEY in environment)
vim.ai.setup({
  default_profile = "openai",
  profiles = {
    openai = {
      provider = "openai",
      model = "gpt-4.1-mini",
      api_key_env = "OPENAI_API_KEY",
    },
  },
})

All :set options mirror Vim — :set wrap, :set clipboard=unnamedplus, :set textwidth=80, etc.

See Configuration and Options Reference for the full list.

Headless Mode & Automation

ovim can run without a terminal — as a programmable text engine with a REST API.

# Start a headless session
ovim file.rs --headless --session dev

# Control it from another terminal
ovim send "iHello, world!<Esc>" -s dev
ovim buffer -s dev
ovim exec "set number" -s dev
ovim context -s dev          # 21-line window around cursor

REST API

Every session exposes an HTTP server:

Endpoint Method Description
/v1/health GET Health check with LSP readiness
/v1/buffer GET / PUT Buffer content
/v1/keys POST Send keystrokes
/v1/command POST Execute ex command
/v1/snapshot GET Complete editor state
/v1/lsp/status GET LSP server states
/v1/mcp POST MCP JSON-RPC 2.0

For AI-agent integration, ovim also speaks MCP over the same session — ovim install claude / ovim install cursor wires it up. See MCP docs if you want it.

CLI Reference

File Operations (no session needed)

ovim edit file.rs --old "foo" --new "bar"
ovim insert file.rs --after 42 --text "new line"
ovim delete-lines file.rs --from 42 --to 45
ovim read-lines file.rs --from 40 --to 60

Session Control

ovim send "ggK" -s dev           # Send keystrokes
ovim exec "set number" -s dev    # Execute ex command
ovim context -s dev              # 21-line context window
ovim buffer -s dev               # Buffer content
ovim search "pattern" -s dev     # Find pattern

LSP Commands

ovim lsp status -s dev           # Server states
ovim lsp hover -s dev            # Hover info at cursor
ovim lsp check file.rs           # Check language detection
ovim lsp languages               # List all supported languages

Session Management

ovim session list                # List active sessions
ovim session kill -s dev         # Kill session
ovim session health -s dev       # Health check
ovim session cleanup --dry-run   # Preview stale session cleanup

Architecture

ovim-core/    Shared library — buffer, syntax, LSP, session logic
ovim/         Binary — TUI, editor, CLI, REST API

Key modules:

  • buffer/ — rope-based text buffer (ropey)
  • syntax/ — tree-sitter grammars and highlight queries
  • lsp/ — language server client with auto-install
  • editor/ — operators, motions, input handling
  • ui/ — terminal rendering (ratatui + crossterm)
  • api/ — REST API and MCP server (Axum)

Documentation

Contributing

Contributions are welcome!

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages