From c2f44d943a49fbc35022f49cd03a45bf227f2747 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Fri, 4 Oct 2024 08:51:02 +0200 Subject: [PATCH] Make Treesitter optional for vim support Still support vim. Therefore make Treesitter adjustments depending on neovim. --- CHANGELOG.md | 6 ++ colors/smyckblue.vim | 144 +++++++++++++++++++++++-------------------- 2 files changed, 82 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51221f5..50d327a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.7.1 2024-10-04 + +### Fixed + +- Keep compatibility with vim, which does not have Treesitter + ## v1.7.0 2024-05-21 ### Added diff --git a/colors/smyckblue.vim b/colors/smyckblue.vim index b31a68e..a0be6a1 100644 --- a/colors/smyckblue.vim +++ b/colors/smyckblue.vim @@ -77,84 +77,92 @@ hi link Number String hi Error cterm=none ctermbg=none ctermfg=red hi Todo cterm=none ctermbg=none ctermfg=yellow -" Treesitter -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 +if has('nvim') -" HTML Treesitter -hi @tag.html cterm=none ctermbg=none ctermfg=green -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 + " Treesitter + 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 -" reStructuredText Treesitter -hi @markup.list.rst cterm=none ctermbg=none ctermfg=blue -hi @markup.heading.rst cterm=none ctermbg=none ctermfg=blue + " HTML Treesitter + hi @tag.html cterm=none ctermbg=none ctermfg=green + 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 -hi @markup.list.markdown cterm=none ctermbg=none ctermfg=blue -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 + " reStructuredText Treesitter + hi @markup.list.rst cterm=none ctermbg=none ctermfg=blue + hi @markup.heading.rst cterm=none ctermbg=none ctermfg=blue -" SQL Treesitter -hi link @keyword.operator.sql @type.builtin -hi link @keyword.sql @type.builtin + " markdown Treesitter + hi @markup.list.markdown cterm=none ctermbg=none ctermfg=blue + 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 hi link xmlTag Identifier hi link xmlTagName Identifier -" PHPDoc Treesitter (Keep everything as comment) -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 +if has('nvim') -" JSON Treesitter -hi link @label.json @string + " PHPDoc Treesitter (Keep everything as comment) + 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 hi DiffAdd cterm=bold ctermbg=2 ctermfg=15