With vim-plug (or your favorite plugin manager):
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'ocaml-mlx/ocaml_mlx.nvim'
Then in init.lua
(before lsp setup):
require 'ocaml_mlx'
Then run :TSInstall ocaml_mlx
to install the treesitter parser.
To enable formatting with ocamlformat-mlx (not yet released on opam), install stevearc/conform.nvim:
Plug 'stevearc/conform.nvim'
Then in init.lua
:
local conform = require 'conform'
conform.setup {
formatters_by_ft = {
ocaml_mlx = {"ocamlformat_mlx"},
}
}