From 63c7e63769231f5196ec09cd4ff031a1d8ca8cb1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 10 Nov 2023 15:22:44 +0100 Subject: Add a README --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..1e3abf3 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# tree-sitter-gsp + +This is a tree-sitter parser for the [GSP][1] language. It has complete support +for the GSP grammar including the ‘>’ node prefix that existed before GSP v3. +This repository also comes with queries for syntax highlighting, code folding, +indentation, etc., as well as automatic filetype detection for Neovim. + +## Neovim Support + +If you would like to use this parser in Neovim, the following configuration is +required. + +### Plugin Installation + +The plugin installation syntax will depend on your package manager. To install +the plugin via Packer, do the following. This will enable the syntax +highlighting amongst other things, and automatic filetype detection. + +```lua +use 'https://git.sr.ht/~mango/tree-sitter-gsp' +``` + +### TS Parser Installation + +The Tree-Sitter parser needs to be specified manually in your nvim-treesitter +configuration. The following should be sufficient. When you’re done, simply +run `:TSInstall gsp` + +```lua +local config = require('nvim-treesitter.parsers').get_parser_configs() +config.gsp = { + install_info = { + url = 'https://git.sr.ht/~mango/tree-sitter-gsp', + files = {'src/parser.c'}, + }, + filetype = 'gsp', +} +``` + +[1]: https://sr.ht/~mango/gsp -- cgit v1.2.3