Make Treesitter optional for vim support

Still support vim.
Therefore make Treesitter adjustments depending on neovim.
This commit is contained in:
Daniel Siepmann 2024-10-04 08:51:02 +02:00
parent e91f74fe98
commit c2f44d943a
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 82 additions and 68 deletions

View file

@ -1,5 +1,11 @@
# Changelog # Changelog
## v1.7.1 2024-10-04
### Fixed
- Keep compatibility with vim, which does not have Treesitter
## v1.7.0 2024-05-21 ## v1.7.0 2024-05-21
### Added ### Added

View file

@ -77,84 +77,92 @@ hi link Number String
hi Error cterm=none ctermbg=none ctermfg=red hi Error cterm=none ctermbg=none ctermfg=red
hi Todo cterm=none ctermbg=none ctermfg=yellow hi Todo cterm=none ctermbg=none ctermfg=yellow
" Treesitter if has('nvim')
hi @namespace cterm=none ctermbg=none ctermfg=white
hi @type cterm=none ctermbg=none ctermfg=blue
hi @type.qualifier cterm=none ctermbg=none ctermfg=blue
hi @type.builtin cterm=none ctermbg=none ctermfg=blue
hi @constant cterm=none ctermbg=none ctermfg=blue
hi @constant.builtin cterm=none ctermbg=none ctermfg=blue
hi @constructor cterm=none ctermbg=none ctermfg=white
hi @variable cterm=none ctermbg=none ctermfg=blue
hi @variable.builtin cterm=none ctermbg=none ctermfg=blue
hi @property cterm=none ctermbg=none ctermfg=blue
hi @method cterm=none ctermbg=none ctermfg=blue
hi @operator cterm=none ctermbg=none ctermfg=green
hi link @method.call @method
hi link @function @method
hi link @function.method @function
hi link @function.call @function
hi link @function.method.call @function.method
hi link @function.builtin @function
hi @attribute cterm=none ctermbg=none ctermfg=blue
hi link @text @string
hi link @punctuation @operator
" HTML Treesitter " Treesitter
hi @tag.html cterm=none ctermbg=none ctermfg=green hi @namespace cterm=none ctermbg=none ctermfg=white
hi @tag.delimiter.html cterm=none ctermbg=none ctermfg=blue hi @type cterm=none ctermbg=none ctermfg=blue
hi @tag.attribute.html cterm=none ctermbg=none ctermfg=blue hi @type.qualifier cterm=none ctermbg=none ctermfg=blue
hi link htmlTag @tag.html hi @type.builtin cterm=none ctermbg=none ctermfg=blue
hi link htmlEndTag @tag.html hi @constant cterm=none ctermbg=none ctermfg=blue
hi link htmlTagN @tag.html hi @constant.builtin cterm=none ctermbg=none ctermfg=blue
hi link @text.uri.html @string hi @constructor cterm=none ctermbg=none ctermfg=white
hi link @text.title.html @string hi @variable cterm=none ctermbg=none ctermfg=blue
hi link @text.title.1.html @string hi @variable.builtin cterm=none ctermbg=none ctermfg=blue
hi link @text.title.2.html @string hi @property cterm=none ctermbg=none ctermfg=blue
hi link @text.title.3.html @string hi @method cterm=none ctermbg=none ctermfg=blue
hi link @text.title.4.html @string hi @operator cterm=none ctermbg=none ctermfg=green
hi link @text.title.5.html @string hi link @method.call @method
hi link @text.title.6.html @string hi link @function @method
hi @operator.html cterm=none ctermbg=none ctermfg=blue hi link @function.method @function
hi link @function.call @function
hi link @function.method.call @function.method
hi link @function.builtin @function
hi @attribute cterm=none ctermbg=none ctermfg=blue
hi link @text @string
hi link @punctuation @operator
" reStructuredText Treesitter " HTML Treesitter
hi @markup.list.rst cterm=none ctermbg=none ctermfg=blue hi @tag.html cterm=none ctermbg=none ctermfg=green
hi @markup.heading.rst cterm=none ctermbg=none ctermfg=blue hi @tag.delimiter.html cterm=none ctermbg=none ctermfg=blue
hi @tag.attribute.html cterm=none ctermbg=none ctermfg=blue
hi link htmlTag @tag.html
hi link htmlEndTag @tag.html
hi link htmlTagN @tag.html
hi link @text.uri.html @string
hi link @text.title.html @string
hi link @text.title.1.html @string
hi link @text.title.2.html @string
hi link @text.title.3.html @string
hi link @text.title.4.html @string
hi link @text.title.5.html @string
hi link @text.title.6.html @string
hi @operator.html cterm=none ctermbg=none ctermfg=blue
" markdown Treesitter " reStructuredText Treesitter
hi @markup.list.markdown cterm=none ctermbg=none ctermfg=blue hi @markup.list.rst cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.1.marker.markdown cterm=none ctermbg=none ctermfg=blue hi @markup.heading.rst cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.2.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.3.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.4.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.5.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.6.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.1.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.2.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.3.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.4.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.5.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.6.markdown cterm=none ctermbg=none ctermfg=blue
" SQL Treesitter " markdown Treesitter
hi link @keyword.operator.sql @type.builtin hi @markup.list.markdown cterm=none ctermbg=none ctermfg=blue
hi link @keyword.sql @type.builtin hi @markup.heading.1.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.2.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.3.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.4.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.5.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.6.marker.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.1.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.2.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.3.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.4.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.5.markdown cterm=none ctermbg=none ctermfg=blue
hi @markup.heading.6.markdown cterm=none ctermbg=none ctermfg=blue
" SQL Treesitter
hi link @keyword.operator.sql @type.builtin
hi link @keyword.sql @type.builtin
endif
" XML Treesitter " XML Treesitter
hi link xmlTag Identifier hi link xmlTag Identifier
hi link xmlTagName Identifier hi link xmlTagName Identifier
" PHPDoc Treesitter (Keep everything as comment) if has('nvim')
hi link @type.phpdoc @comment
hi link @attribute.phpdoc @comment
hi link @parameter.phpdoc @comment
hi link @variable.phpdoc @comment
hi link @keyword.phpdoc @comment
hi link @text.phpdoc @comment
hi link @text.uri.phpdoc @comment
" JSON Treesitter " PHPDoc Treesitter (Keep everything as comment)
hi link @label.json @string hi link @type.phpdoc @comment
hi link @attribute.phpdoc @comment
hi link @parameter.phpdoc @comment
hi link @variable.phpdoc @comment
hi link @keyword.phpdoc @comment
hi link @text.phpdoc @comment
hi link @text.uri.phpdoc @comment
" JSON Treesitter
hi link @label.json @string
endif
" Diff " Diff
hi DiffAdd cterm=bold ctermbg=2 ctermfg=15 hi DiffAdd cterm=bold ctermbg=2 ctermfg=15