Skip to content

kalebhenrique/lazyrails.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lazyrails.nvim

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

Features

Navigation helpers

Jump from any Rails file to its counterpart.
When multiple candidates exist a Telescope 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.

Test runner

Supports both minitest (test/) and RSpec (spec/) projects.

Run specs/tests without leaving the editor.
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"
end

Installation

lazy.nvim (recommended)

{
  "kalebhenrique/lazyrails.nvim",
  ft = { "ruby", "eruby" },
  dependencies = {
    "nvim-telescope/telescope.nvim",
    "nvim-lua/plenary.nvim",
  },
  opts = {}, -- see Configuration section below
}

Configuration (optional)

require("lazyrails").setup({
  test = {
    pass_icon = "",
    fail_icon = "",
    notification = { timeout = false },
  },
})

Optional dependencies


Keybinding reference

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

All keys live under the Rails group visible in which-key.

About

Neovim plugin for Ruby on Rails navigation and test helpers

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages