]> git.rmz.io Git - dotfiles.git/blobdiff - nvim/lua/plugins/lang/ruby.lua
lazyvim: absorb all langs
[dotfiles.git] / nvim / lua / plugins / lang / ruby.lua
diff --git a/nvim/lua/plugins/lang/ruby.lua b/nvim/lua/plugins/lang/ruby.lua
new file mode 100644 (file)
index 0000000..d434dcf
--- /dev/null
@@ -0,0 +1,54 @@
+return {
+  { "nvim-treesitter/nvim-treesitter",
+    opts = { ensure_installed = { "ruby" } },
+  },
+  { "neovim/nvim-lspconfig",
+    ---@class PluginLspOpts
+    opts = {
+      ---@type lspconfig.options
+      servers = {
+        ruby_lsp = { enabled = true, },
+        rubocop = { enabled = true, },
+      },
+    },
+  },
+  { "williamboman/mason.nvim",
+    opts = { ensure_installed = { "erb-formatter", "erb-lint" } },
+  },
+  {
+    "mfussenegger/nvim-dap",
+    dependencies = {
+      "suketa/nvim-dap-ruby",
+      config = function()
+        require("dap-ruby").setup()
+      end,
+    },
+  },
+  { "stevearc/conform.nvim",
+    opts = {
+      formatters_by_ft = {
+        ruby = { "rubocop" },
+        eruby = { "erb_format" },
+      },
+    },
+  },
+  { "nvim-neotest/neotest",
+    dependencies = {
+      "olimorris/neotest-rspec",
+    },
+    opts = {
+      adapters = {
+        ["neotest-rspec"] = {
+          -- NOTE: By default neotest-rspec uses the system wide rspec gem instead of the one through bundler
+          -- rspec_cmd = function()
+          --   return vim.tbl_flatten({
+          --     "bundle",
+          --     "exec",
+          --     "rspec",
+          --   })
+          -- end,
+        },
+      },
+    },
+  },
+}