tree-sitter-cobweb

April 21, 2025 ยท View on GitHub

Tree sitter parser and highlighter for .cob or .cobweb files used for bevy_cobweb_ui

Instructions

Neovim

1. Add filetype detection (for .cob and .cobweb)

In your init.lua or Neovim config:

vim.filetype.add({
  extension = {
    cob = "cobweb",
    cobweb = "cobweb",
  },
})

This tells Neovim to treat files with the .cob or .cobweb extensions as cobweb filetypes.


2. Install the Tree-sitter parser

-- In your `init.lua`
require'nvim-treesitter.parsers'.get_parser_configs().cobweb = {
  install_info = {
    url = "https://github.com/FabricSoul/tree-sitter-cobweb",
    files = { "src/parser.c", }, -- if you use scanner.c
    branch = "main", -- or whatever branch has your parser
  },
  filetype = "cobweb",
}

Then run:

:TSInstall cobweb