Helix integration is currently available in my fork. There is currently no plan to upstream the changes as MimIR is not (yet) relevant to the public and the grammar itself does not handle all of its grammar properly. This will be moved to a plugin once plugin support lands in helix master.
A VSCode plugin is available here
Neovim does not know about Mim yet, so nvim-treesitter (branch main) has to be told about this
repository. Unlike Helix, Neovim uses the queries in queries/ - capture names differ
between the two editors, so the Helix queries linked above will not work here.
vim-mim already does step 1 for you and adds what a grammar cannot provide - filetype detection, comment settings, and abbreviations for the Unicode terminals - plus a regex syntax file that Neovim falls back to whenever the parser is missing. With it installed, only step 2 is left.
- Add the following to your
init.lua:
vim.filetype.add({
extension = { mim = "mim" },
})
vim.api.nvim_create_autocmd("User", {
pattern = "TSUpdate",
callback = function()
require("nvim-treesitter.parsers").mim = {
install_info = {
url = "https://github.com/mimir/tree-sitter-mim",
queries = "queries",
},
}
end,
})-
Run
:TSInstall miminside of Neovim. This downloads the repository, compilessrc/parser.cand installsqueries/.:TSUpdate mimpulls a newer version later on. -
nvim-treesittermaindoes not enable highlighting by itself. Distributions such as LazyVim do it for you; otherwise add
vim.api.nvim_create_autocmd("FileType", {
pattern = "mim",
callback = function()
vim.treesitter.start()
end,
})Point install_info at a local clone instead - queries/ is then symlinked into Neovim's parser
directory, so edits to the .scm files take effect right away and only :TSInstall! mim is needed
after a change to grammar.js:
install_info = {
path = vim.fn.expand("~/treesitter/tree-sitter-mim"),
queries = "queries",
generate = false,
generate_from_json = false,
},