Ruby support for Neovim
  • Ruby 90.6%
  • Vim Script 8.5%
  • Shell 0.5%
  • Lua 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryota Horiuchi 1200dce248
Replace deprecated multi_json with stdlib JSON (#120)
multi_json deprecated encode/decode in 1.21; the only use is the log
formatter, so switch to stdlib JSON and drop the dependency.
2026-06-29 18:03:39 -07:00
.github/workflows Remove vim-flavor dependency (#117) 2026-02-22 09:06:11 -08:00
exe Split executable logic into CLI class 2020-05-03 11:28:17 -07:00
lib Replace deprecated multi_json with stdlib JSON (#120) 2026-06-29 18:03:39 -07:00
script Remove vim-flavor dependency (#117) 2026-02-22 09:06:11 -08:00
spec Replace deprecated multi_json with stdlib JSON (#120) 2026-06-29 18:03:39 -07:00
.gitignore Remove vim-flavor dependency (#117) 2026-02-22 09:06:11 -08:00
CHANGELOG.md Bump version 2024-06-09 18:04:55 -07:00
CODE_OF_CONDUCT.md [skip ci] Fixup README, use https for all links 2020-05-10 18:30:11 -07:00
Gemfile Use new vim-flavor release, keep flavors up to date 2018-01-31 08:53:04 -08:00
LICENSE.txt initial commit 2014-05-12 21:18:53 -07:00
neovim.gemspec Replace deprecated multi_json with stdlib JSON (#120) 2026-06-29 18:03:39 -07:00
Rakefile Remove vim-flavor dependency (#117) 2026-02-22 09:06:11 -08:00
README.md Add basic remote module support (#107) 2024-06-09 18:01:17 -07:00

Neovim Ruby

Build Status Gem Version

Ruby support for Neovim.

Installation

Add this line to your application's Gemfile:

gem "neovim"

And then execute:

bundle

Or install it yourself as:

gem install neovim

Usage

Neovim supports the --listen option for specifying an address to serve its RPC API. To connect to Neovim over a Unix socket, start it up like this:

$ nvim --listen /tmp/nvim.sock

You can then connect to that socket path to get a Neovim::Client:

require "neovim"
client = Neovim.attach_unix("/tmp/nvim.sock")

Refer to the Neovim docs for other ways to connect to nvim, and the Neovim::Client docs for a summary of the client interface.

Remote Modules

Remote modules allow users to define custom handlers in Ruby. To implement a remote module:

  • Define your handlers in a plain Ruby script that imports neovim
  • Spawn the script from lua using jobstart
  • Define commands in lua using nvim_create_user_command that route to the job's channel ID

For usage examples, see:

Note: Remote modules are a replacement for the deprecated "remote plugin" architecture. See https://github.com/neovim/neovim/issues/27949 for details.

Vim Plugin Support

The Neovim gem also acts as a compatibility layer for Ruby plugins written for vim. The :ruby, :rubyfile, and :rubydo commands are intended to match their original behavior, and their documentation can be found here.

Contributing

  1. Fork it (https://github.com/neovim/neovim-ruby/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request