summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorkiyan <yazdani.kiyan@protonmail.com>2022-02-06 13:34:08 +0100
committerKiyan <yazdani.kiyan@protonmail.com>2022-02-06 14:30:57 +0100
commit58a4897e6d5f21a9178ae0f802d47af26d67a219 (patch)
tree74336582ebfd82021824d9710096065d0d6a3727 /README.md
parentd7eab3a5a9ddcbd6d2719ca065601c8a0f4f11c8 (diff)
refacto: deprecate used_by in parsers.lua
- remove print_warning function from utils.lua (unused) - cleanup some functions in parsers.lua (parameters overloading and wrong bufnr used). - log a deprecation notice when using used_by in a parser definition - default the filetype_to_parsername table to the list of filetypes previously in the used_by keys - update the README to indicate that change
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 0601bfb5..a2c593b8 100644
--- a/README.md
+++ b/README.md
@@ -355,12 +355,19 @@ parser_config.zimbu = {
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
},
- filetype = "zu", -- if filetype does not agrees with parser name
- used_by = {"bar", "baz"} -- additional filetypes that use this parser
+ filetype = "zu", -- if filetype does not match the parser name
}
EOF
```
+If you wish to set a specific parser for a filetype, you should extend the `filetype_to_parsername` table:
+```vim
+lua <<EOF
+local ft_to_parser = require"nvim-treesitter.parser".filetype_to_parsername
+filetype_to_parsername.someft = "python" -- the someft filetype will use the python parser and queries.
+EOF
+```
+
4. Start `nvim` and `:TSInstall zimbu`.
You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`.