got millet working!
This commit is contained in:
parent
aac3cd9064
commit
a3cc6c5675
3 changed files with 51 additions and 0 deletions
30
nvim/.config/nvim/lua/plugins/languages/sml.lua
Normal file
30
nvim/.config/nvim/lua/plugins/languages/sml.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
{
|
||||
'jez/vim-better-sml',
|
||||
config = function()
|
||||
vim.g.sml_smlnj_executable = 'smlnj'
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>rs',
|
||||
[[:SMLReplStart<CR>]],
|
||||
desc = 'SML start repl'
|
||||
},
|
||||
{
|
||||
'<leader>rc',
|
||||
[[:SMLReplClear<CR>]],
|
||||
desc = 'SML clear repl'
|
||||
},
|
||||
{
|
||||
'<leader>rb',
|
||||
[[:SMLReplBuild<CR>]],
|
||||
desc = 'SML load current file/CM project in repl'
|
||||
},
|
||||
{
|
||||
'<leader>ro',
|
||||
[[:SMLReplOpen<CR>]],
|
||||
desc = 'SML open current structure in repl'
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,14 @@ return {
|
|||
}
|
||||
})
|
||||
|
||||
lspconfig.millet.setup({
|
||||
root_dir = function(fname)
|
||||
local util = require("lspconfig.util")
|
||||
return util.root_pattern(".cm", ".mlb")(fname)
|
||||
or util.path.dirname(fname)
|
||||
end
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
|
|
|
|||
|
|
@ -82,5 +82,18 @@ return {
|
|||
-- end
|
||||
-- }
|
||||
}
|
||||
},
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||
sml = { 'smlfmt' },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_format = 'fallback',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue