Markdoc grammar for tree-sitter
- Define a new filetype for markdoc.
vim.filetype.add({
extension = {
mdoc = "markdoc",
},
})
- Add markdoc parser config in nvim-treesitter.
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.markdoc = {
install_info = {
url = "https://github.com/mohitsinghs/tree-sitter-markdoc",
files = { "src/parser.c" },
branch = "main",
},
filetype = "markdoc",
}
-
Copy queries to
~/.config/nvim/queries/markdoc
. -
Run
:TSInstall markdoc