Neovim plugin for Ruby on Rails – focused on navigation and test running,
designed for LazyVim with sensible <leader>r keybindings.
Inspired by ror.nvim by Wei Zhe. Credits are retained in the MIT License.
video.mp4
Jump from any Rails file to its counterpart.
When multiple candidates exist a Snacks picker opens automatically.
| From | To | Key |
|---|---|---|
| model / controller / view | model | <leader>rm |
| model / view / test | controller | <leader>rc |
| model / controller | view | <leader>rv |
| model / controller | test / spec | <leader>rs |
Inertia + React support – when navigating to a view (<leader>rv) from a controller that uses render inertia:, the plugin resolves the matching .jsx / .tsx component under app/frontend/pages/ automatically.
Supports both minitest (test/) and RSpec (spec/) projects.
Run specs/tests directly on the current file and results (pass ✅ / fail ❌) are shown inline in the buffer as virtual text and diagnostics.
| Action | Key |
|---|---|
| Run whole test file | <leader>rt |
| Clear test results | <leader>rX |
RSpec requires no extra setup.
Minitest requires minitest-json-reporter and minitest 5.x (minitest 6+ is not yet compatible):
# Gemfile
gem "minitest", "~> 5.25"
group :test do
gem "minitest-json-reporter"
endSupport rubocop and herb-tools
Run lint directly on the current file with inline diagnostics and pass/fail notification.
| Action | Key |
|---|---|
| Run lint for current file | <leader>rl |
| Clear lint results | <leader>rL |
Lint behavior is file-type based:
*.rb→bundle exec rubocop --format json*.html.erb→npx --no-install @herb-tools/linter --json
{
"kalebhenrique/lazyrails.nvim",
ft = { "ruby", "eruby" },
dependencies = {
"folke/snacks.nvim",
"nvim-lua/plenary.nvim",
},
opts = {}, -- see Configuration section below
}require("lazyrails").setup({
test = {
pass_icon = "✅",
fail_icon = "❌",
notification = { timeout = false },
},
lint = {
pass_icon = "✅",
fail_icon = "❌",
notification = { timeout = false },
},
})- nvim-notify – beautiful test result notifications
- dressing.nvim – nicer
vim.ui.select/vim.ui.inputappearance - which-key.nvim – group label shown automatically under
<leader>r
| Key | Command | Description |
|---|---|---|
<leader>rm |
RailsGoModel |
Go to model |
<leader>rc |
RailsGoController |
Go to controller |
<leader>rv |
RailsGoView |
Go to view |
<leader>rs |
RailsGoTest |
Go to test / spec file |
<leader>rt |
RailsTestRun |
Run test file |
<leader>rX |
RailsTestClear |
Clear test results |
<leader>rl |
RailsLintRun |
Run lint for current file |
<leader>rL |
RailsLintClear |
Clear lint results |
All keys live under the Rails group visible in which-key.