aboutsummaryrefslogtreecommitdiffhomepage
path: root/sundry/editor-syntax-etc/nvim/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'sundry/editor-syntax-etc/nvim/README.md')
-rw-r--r--sundry/editor-syntax-etc/nvim/README.md87
1 files changed, 87 insertions, 0 deletions
diff --git a/sundry/editor-syntax-etc/nvim/README.md b/sundry/editor-syntax-etc/nvim/README.md
new file mode 100644
index 0000000..8e889e7
--- /dev/null
+++ b/sundry/editor-syntax-etc/nvim/README.md
@@ -0,0 +1,87 @@
+# Neovim integration for SiSU spine markup
+
+Tree-sitter-backed syntax highlighting, folding, and structural
+navigation for `.sst` / `.ssm` / `.ssi` files in Neovim (>= 0.9).
+
+## What is in this directory
+
+```
+nvim/
+ ftdetect/sisu.lua - register .sst/.ssm/.ssi as filetype "sisu"
+ ftplugin/sisu.lua - per-buffer settings (commentstring, conceal)
+ lua/sisu-spine/init.lua - entry point: registers parser config
+ queries/sisu/ - tree-sitter queries (mirrors tree-sitter-sisu/queries/)
+ highlights.scm
+ folds.scm
+ injections.scm
+ textobjects.scm
+ indents.scm
+```
+
+## Install (manual)
+
+1. Symlink or copy this directory into your Neovim runtime path:
+
+ ```sh
+ ln -s /path/to/sisudoc-spine/sundry/editor-syntax-etc/nvim \
+ ~/.config/nvim/pack/sisu/start/sisu-spine
+ ```
+
+2. Tell `nvim-treesitter` how to fetch the parser. Add to your config
+ (`init.lua`):
+
+ ```lua
+ require("sisu-spine").setup()
+ require("nvim-treesitter.configs").setup({
+ ensure_installed = { "sisu" },
+ highlight = { enable = true },
+ indent = { enable = true },
+ fold = { enable = true },
+ textobjects = { select = { enable = true, lookahead = true } },
+ })
+ ```
+
+3. Build the parser:
+
+ ```vim
+ :TSInstall sisu
+ ```
+
+That is it. Open a `.sst` file - highlighting, folding, and textobject
+selection should all work.
+
+## Install (lazy.nvim)
+
+```lua
+{
+ dir = "/path/to/sisudoc-spine/sundry/editor-syntax-etc/nvim",
+ name = "sisu-spine",
+ ft = { "sisu" },
+ dependencies = { "nvim-treesitter/nvim-treesitter" },
+ config = function()
+ require("sisu-spine").setup()
+ end,
+}
+```
+
+## Sync queries from upstream
+
+The query files are duplicated from `tree-sitter-sisu/queries/` so that
+this Neovim drop-in works without depending on the parser repo's
+checkout layout. To refresh them after grammar changes:
+
+```sh
+cp ../../../sisudoc-spine-tools/tree-sitter-sisu/queries/*.scm \
+ queries/sisu/
+```
+
+(Path is relative to this README.)
+
+## Upstreaming the parser
+
+When the parser is publicly hosted under a stable URL it is worth
+submitting a config to `nvim-treesitter` so users can run `:TSInstall
+sisu` without the local `setup()` call. The required fields are in
+`lua/sisu-spine/init.lua` (`install_info` table); send a PR to
+<https://github.com/nvim-treesitter/nvim-treesitter> patching
+`lua/nvim-treesitter/parsers.lua`.