summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorkiyan <yazdani.kiyan@protonmail.com>2022-02-06 15:15:42 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-02-19 18:26:51 +0100
commit560e8fb4500ac481601d2511b40f730b4515820e (patch)
tree88e745b744e36041fd8a2cfab9f7b271ecdd4a2e /README.md
parentaf71c25edce0861589a51c630525bd0b06ba6a41 (diff)
refacto: expose a function to set custom capture for the higlighter
BREAKING: deprecate custom_captures from highlight config. This allows plugin authors to extend the map. It also avoids settings user configuration specific values during the highlighter initialization (SOC). Not sure how much value this brings, and might potentially break a lot of people configurations. This is questionable.
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/README.md b/README.md
index ca0719c5..05df7a1e 100644
--- a/README.md
+++ b/README.md
@@ -273,10 +273,6 @@ Consistent syntax highlighting.
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
- custom_captures = {
- -- Highlight the @foo.bar capture group with the "Identifier" highlight group.
- ["foo.bar"] = "Identifier",
- },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
@@ -286,6 +282,17 @@ require'nvim-treesitter.configs'.setup {
}
```
+You can add custom highlight captures with:
+
+```vim
+lua <<EOF
+ require"nvim-treesitter.highlight".set_custom_captures {
+ -- Highlight the @foo.bar capture group with the "Identifier" highlight group.
+ ["foo.bar"] = "Identifier",
+ }
+EOF
+```
+
#### Incremental selection
Incremental selection based on the named nodes from the grammar.