feat: add nvim-metals

This commit is contained in:
Kitso Gidion Namane 2024-07-06 16:35:53 +02:00
parent 73fa0eebf9
commit 4e79d031a7
No known key found for this signature in database
GPG Key ID: 7BF6158A95B74623
1 changed files with 27 additions and 1 deletions

View File

@ -155,7 +155,7 @@ vim.opt.cursorline = true
vim.opt.scrolloff = 10
-- fix indentation
vim.o.tab = 4
-- vim.o.tab = 4
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
@ -755,6 +755,32 @@ require('lazy').setup({
-- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
{
'scalameta/nvim-metals',
dependencies = {
'nvim-lua/plenary.nvim',
},
ft = { 'scala', 'sbt', 'java' },
opts = function()
local metals_config = require('metals').bare_config()
metals_config.on_attach = function(client, bufnr)
-- your on_attach function
end
return metals_config
end,
config = function(self, metals_config)
local nvim_metals_group = vim.api.nvim_create_augroup('nvim-metals', { clear = true })
vim.api.nvim_create_autocmd('FileType', {
pattern = self.ft,
callback = function()
require('metals').initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})
end,
},
{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
config = function()