diff options
Diffstat (limited to 'sundry/editor-syntax-etc/nvim/lua')
| -rw-r--r-- | sundry/editor-syntax-etc/nvim/lua/sisu-spine/init.lua | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sundry/editor-syntax-etc/nvim/lua/sisu-spine/init.lua b/sundry/editor-syntax-etc/nvim/lua/sisu-spine/init.lua new file mode 100644 index 0000000..d1ae3df --- /dev/null +++ b/sundry/editor-syntax-etc/nvim/lua/sisu-spine/init.lua @@ -0,0 +1,43 @@ +-- Entry point for the SiSU spine markup Neovim integration. +-- +-- Registers a tree-sitter parser config so users can run +-- :TSInstall sisu +-- to fetch and build the parser via nvim-treesitter. +-- +-- The parser source lives can be found under the +-- `projects/` namespace on git.sisudoc.org. + +local M = {} + +--- Register the `sisu` parser with nvim-treesitter and ensure that +--- `.sst` / `.ssm` / `.ssi` are detected as filetype "sisu". +--- +--- Call once from your init.lua before invoking `:TSInstall sisu`. +function M.setup() + local ok, parsers = pcall(require, "nvim-treesitter.parsers") + if not ok then + vim.notify( + "sisu-spine: nvim-treesitter is not installed; " + .. "syntax highlighting will not be available.", + vim.log.levels.WARN + ) + return + end + + local parser_config = parsers.get_parser_configs() + parser_config.sisu = { + install_info = { + url = "https://git.sisudoc.org/projects/tree-sitter-sisu", + files = { + "src/parser.c", + "src/scanner.c", + }, + branch = "main", + generate_requires_npm = false, + requires_generate_from_grammar = false, + }, + filetype = "sisu", + } +end + +return M |
