diff --git a/README.md b/README.md index 035a432..72f4070 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,23 @@ a perl parser for javascript ## Run examples `npm run example` + +# Installation with nvim-treesitter + +To use this parser in nvim with nvim-treesitter, add this somewhere in your lua config files + +```lua +local parser_config = require "nvim-treesitter.parsers".get_parser_configs() +parser_config.perl = { + install_info = { + url = 'https://github.com/leonerd/tree-sitter-perl', + files = {"src/parser.c", "src/scanner.cc"}, + generate_requires_npm = true + }, + filetype = "perl" +} +``` + +This will override the version that's bundled with nvim-treesitter. We hope that +eventually this version will be bundled instead of the current one. Now you can +`:TSInstall perl` and proceed as usual.