diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-03-20 15:19:14 -0400 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-03-20 15:19:14 -0400 |
| commit | de49363c1af68984787ddf1e0cca7d4c69be33a2 (patch) | |
| tree | c82057ba572d85cd4a4f8cba884a7a7cb3a1fdaa /modules/neovim/default.nix | |
| parent | e3b494cdf1bf0049a0797ec1c14ca279b1f253ec (diff) | |
| download | home-de49363c1af68984787ddf1e0cca7d4c69be33a2.tar.gz | |
modules/neovim: use metals-nvim plugin instead of plain lsp
Diffstat (limited to 'modules/neovim/default.nix')
| -rw-r--r-- | modules/neovim/default.nix | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 606e012..4056213 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -72,7 +72,6 @@ in ruff nixfmt-rfc-style scalafmt - metals stylua black isort @@ -82,6 +81,8 @@ in starpls verible kdePackages.qtdeclarative + coursier + metals ]; xdg.configFile."nvim/lua" = { source = ./nvim/lua; @@ -170,6 +171,34 @@ in ''; } + { + plugin = nvim-metals; + type = "lua"; + config = + # lua + '' + require("lz.n").load({ + "nvim-metals", + ft = { "scala", "sbt", "java" }, + after = function() + local config = require("config.lsp.metals") + -- config.settings.metalsBinaryPath = "metals" + + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + pattern = { "scala", "sbt", "java" }, + callback = function() + require("metals").initialize_or_attach(config) + end, + group = nvim_metals_group, + }) + + require("metals").initialize_or_attach(config) + end, + }) + ''; + } + tmux-nvim nvim-lspconfig { |