feat: add nvim-metals
This commit is contained in:
parent
73fa0eebf9
commit
4e79d031a7
28
init.lua
28
init.lua
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue