diff options
| author | kiyan <yazdani.kiyan@protonmail.com> | 2022-02-06 15:15:42 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-19 18:26:51 +0100 |
| commit | 560e8fb4500ac481601d2511b40f730b4515820e (patch) | |
| tree | 88e745b744e36041fd8a2cfab9f7b271ecdd4a2e /doc | |
| parent | fix(vim): fix highlight for pattern (diff) | |
| download | nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.tar nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.tar.gz nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.tar.bz2 nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.tar.lz nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.tar.xz nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.tar.zst nvim-treesitter-560e8fb4500ac481601d2511b40f730b4515820e.zip | |
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 'doc')
| -rw-r--r-- | doc/nvim-treesitter.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index f3f03bfe8..e7f7932cf 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -71,7 +71,6 @@ MODULES *nvim-treesitter-modules* |nvim-treesitter| provides several functionalities via modules (and submodules), each module makes use of the query files defined for each language, -you can add your own queries too, see |nvim-treesitter-query-extensions|. All modules are disabled by default, and some provide default keymaps. Each module corresponds to an entry in the dictionary passed to the @@ -133,8 +132,6 @@ Supported options: - enable: `true` or `false`. - disable: list of languages. -- custom_captures: A map of user defined capture groups to highlight groups. - See |nvim-treesitter-query-extensions|. - additional_vim_regex_highlighting: `true` or `false`, or a list of languages. Set this to `true` if you depend on 'syntax' being enabled (like for indentation). Using this option may slow down your editor, @@ -154,6 +151,16 @@ Supported options: }, } < + +You can also set custom highlight captures +> + lua <<EOF + require"nvim-treesitter.highlight".set_custom_captures { + -- Highlight the @foo.bar capture group with the "Identifier" highlight group. + ["foo.bar"] = "Identifier", + } + EOF +< Note: The api is not stable yet. ------------------------------------------------------------------------------ |
