
Neovim Ruby
https://github.com/neovim/neovim-ruby- Category
- Developer Tools
- Rank
- No. 834Tools index
Previous survey · No. 819 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- neovim
- GitHub
- 368 stars
- Date
About
Ruby client library and remote plugin host for Neovim.
What it does
It lets Ruby programs control a running Neovim instance through RPC. Programs can connect over sockets or launch an embedded child process, then work with editor state such as buffers, windows, tabs, options, commands, and events. Ruby scripts can also expose custom handlers that Lua commands invoke through a job channel.
Why it's ranked here
The strongest reason to choose it is broad access to Neovim without manually wrapping every editor operation. It discovers the available API at runtime and presents editor objects through Ruby. The package also preserves support for older Vim-style Ruby commands. Its main constraint is architectural: plugin calls stay on the main thread, and current guidance favors remote modules over the deprecated remote plugin model.
What's good
Runtime API discovery keeps the Ruby interface aligned with the Neovim instance it connects to. Returned buffers, windows, and tabs become dedicated Ruby objects instead of raw identifiers. The session layer presents synchronous requests while still handling callbacks through fibers. Connections cover Unix sockets, TCP, and spawned child processes. Structured JSON logging can target standard error or a configured file.
Tradeoffs
The client depends on a running or spawned Neovim process and its RPC API. Ruby plugin code cannot call Neovim outside the main thread. Remote modules require coordination with Lua: Lua starts the Ruby job and routes commands through its channel. The repository still contains machinery and documentation for the deprecated remote plugin architecture, which may complicate choosing the current integration pattern.
How to use it well
Use it when Ruby is your preferred language for editor automation, external tooling, or custom Neovim handlers. Connect through a Unix socket for local automation, TCP where an addressable server fits, or an embedded child for process-controlled workflows. For new extensions, follow the remote module pattern and keep Neovim calls on the main thread. It does not replace Neovim, provide a standalone editor, or remove the Lua wiring needed for user commands.
Technical notes+
lib/neovim.rb exposes TCP, Unix-socket, and child-process attachment plus remote-module startup. lib/neovim/client.rb requests API metadata at runtime, registers MessagePack extension types, and dispatches discovered RPC methods through method_missing. lib/neovim/api.rb maps Neovim function names to client, buffer, window, and tabpage objects. lib/neovim/session.rb uses Fiber-based response handling to offer synchronous requests and explicitly rejects calls outside the originating thread. lib/neovim/host.rb loads plugin handlers, registers client information, returns plugin specs, and distinguishes synchronous requests from notifications. lib/neovim/logging.rb emits JSON-formatted records configured by NVIM_RUBY_LOG_FILE and NVIM_RUBY_LOG_LEVEL.
Observed
- Primary language
- Ruby
- Packaging
- Distributed as the neovim Ruby gem; supports Gemfile installation with Bundler or direct installation through RubyGems.
- Library interface
- Ruby API for connecting to and controlling Neovim through RPC.
- Connection surfaces
- Unix domain sockets, TCP sockets, and spawned child Neovim processes.
- Extension interfaces
- Remote modules with Ruby handlers invoked through Lua job channels, plus compatibility for Vim-style Ruby commands.
- API structure
- Client, buffer, window, and tabpage interfaces are derived from API metadata returned by the connected Neovim instance.
- Concurrency constraint
- Calls into Neovim are restricted to the session's main thread.
Read from README.md, Gemfile, lib/neovim.rb, lib/neovim/api.rb, lib/neovim/host.rb, lib/neovim/buffer.rb, lib/neovim/client.rb, lib/neovim/plugin.rb, lib/neovim/window.rb, lib/neovim/current.rb, lib/neovim/logging.rb, lib/neovim/message.rb, lib/neovim/session.rb, lib/neovim/tabpage.rb, lib/neovim/version.rb.
What it can do
Connect Ruby applications to Neovim editor
Ruby application code and Neovim instance → Established connection between Ruby app and Neovim
Execute Ruby code within Neovim environment
Ruby code snippets or scripts → Executed Ruby code results in Neovim
Create Ruby-based Neovim plugins
Ruby plugin code and plugin specifications → Functional Neovim plugin written in Ruby
Send commands from Ruby to Neovim
Ruby method calls and Neovim command parameters → Executed Neovim commands and operations
Access Neovim buffers from Ruby code
Buffer identifiers and Ruby access requests → Buffer content and metadata
Manipulate Neovim editor state via Ruby
Ruby commands for editor manipulation → Modified Neovim editor state (cursor position, text, etc.)
Host remote Ruby plugins for Neovim
Ruby plugin files and host configuration → Running remote plugin process accessible to Neovim
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.