Lisp support and so on
This commit is contained in:
parent
e145f9f06d
commit
e9fe358191
4 changed files with 65 additions and 0 deletions
26
lua/plugins/nvim-metals.lua
Normal file
26
lua/plugins/nvim-metals.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
'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
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover)
|
||||
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,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue