mirror of
https://github.com/nix-community/nixvim.git
synced 2026-08-24 10:14:03 -05:00
This commit improves Nixvim's native tree-sitter setup for the modern nvim-treesitter main branch. The intent was to bring more customizations that were lost after switching from master branch. In particular: - `highlight.disable` option now accepts a raw function compatible with disable parameter from master branch. Additionally it accepts a third filetype parameter - add `highlight.enableVimSyntax` option to enable :h syntax for chosen filetypes. Syntax is sometimes needed for indent files, some vim scripts, or to improve highlighting for compopund filetypes - `indent` and `folding` now also have `disable` support - all features are now enabled only when the parser and queries are available for current filetype. This avoids setting 'indentexpr' and 'foldexpr' when they cannot work because of missing parser or queries - adds commands to `b:undo_ftplugin` variable to undo options set. The content of this variable is automatically executed by Nvim when switching filetype (by ftplugin). This is needed so that options were reset if the filetype is changed. Previously stale options were left.