Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Setting up LSP in Nvim

Neovim 0.11+ has everything built in, no nvim-lspconfig needed:

vim.filetype.add({ extension = { m2 = "macaulay2" } }) -- not needed with m2.nvim

vim.lsp.config("m2_ls", {
  cmd = { "m2-ls" },
  filetypes = { "macaulay2" },
  root_markers = { ".git" },
})
vim.lsp.enable("m2_ls")

To change server settings, add them to the same call:

vim.lsp.config("m2_ls", {
  -- ...
  settings = {
    ["m2-ls"] = {
      -- see the m2-ls configuration table
    },
  },
})

Check it’s running with :checkhealth vim.lsp while a .m2 file is open.

Inlay type hints are off by default in Neovim; turn them on with vim.lsp.inlay_hint.enable(true).