got millet working!

This commit is contained in:
William Ball 2025-03-17 23:23:31 -07:00
parent aac3cd9064
commit a3cc6c5675
Signed by: wball
GPG key ID: B8682D8137B70765
3 changed files with 51 additions and 0 deletions

View 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'
},
}
}
}

View file

@ -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)

View file

@ -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',
}
}
}
}