-- Then you need to enable it, e.g., inside init.lua: -- vim.lsp.enable("ruby-lsp") -- on Linux and macOS the default location is ~/.config/nvim/lsp/ruby-lsp.lua return { filetypes = { "ruby" }, cmd = { "ruby-lsp" } -- or { "bundle", "exec", "ruby-lsp" }, root_markers = { "Gemfile", ".git" }, init_options = { formatter = 'standard', linters = { 'standard' }, addonSettings = { ["Ruby LSP Rails"] = { enablePendingMigrationsPrompt = false, }, }, }, } -- Additional setup (optional) -- -- rubyLsp/workspace/dependencies is a custom method currently supported only in the VS Code plugin. The following snippet adds ShowRubyDeps command to show dependencies in the quickfix list. local function add_ruby_deps_command(client, bufnr) vim.api.nvim_buf_create_user_command(bufnr, "ShowRubyDeps", function(opts) local params = vim.lsp.util.make_text_document_params() local showAll = opts.args == "all" client.request("rubyLsp/workspace/dependencies", params, function(error, result) if error then print("Error showing deps: " .. error) return end local qf_list = {} for _, item in ipairs(result) do if showAll or item.dependency then table.insert(qf_list, { text = string.format("%s (%s) - %s", item.name, item.version, item.dependency), filename = item.path }) end end vim.fn.setqflist(qf_list) vim.cmd('copen') end, bufnr) end, {nargs = "?", complete = function() return {"all"} end}) end require("lspconfig").ruby_lsp.setup({ on_attach = function(client, buffer) add_ruby_deps_command(client, buffer) end, })