From dbc09df252dd9b5ba03b0b3bff2c4097d2d2ff6a Mon Sep 17 00:00:00 2001 From: yuys13 Date: Mon, 17 Oct 2022 21:47:28 +0900 Subject: [PATCH 1/5] feat(treesitter)!: use @foo.bar style highlight groups nvim-treesitter has removed `TS*` highlight groups. Thus we need to use @foo.bar style highlight groups. --- after/plugin/dracula.vim | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index 3fd3c32..3f60596 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -69,34 +69,34 @@ endif " https://github.com/nvim-treesitter/nvim-treesitter/blob/master/plugin/nvim-treesitter.vim if exists('g:loaded_nvim_treesitter') " # Misc - hi! link TSPunctSpecial Special + hi! link @punctuation.special Special " # Constants - hi! link TSConstMacro Macro - hi! link TSStringEscape Character - hi! link TSSymbol DraculaPurple - hi! link TSAnnotation DraculaYellow - hi! link TSAttribute DraculaGreenItalic + hi! link @constant.macro Macro + hi! link @string.escape Character + hi! link @symbol DraculaPurple + hi! link @annotation DraculaYellow + hi! link @attribute DraculaGreenItalic " # Functions - hi! link TSFuncBuiltin DraculaCyan - hi! link TSFuncMacro Function - hi! link TSParameter DraculaOrangeItalic - hi! link TSParameterReference DraculaOrange - hi! link TSField DraculaOrange - hi! link TSConstructor DraculaCyan + hi! link @function.builtin DraculaCyan + hi! link @funcion.macro Function + hi! link @parameter DraculaOrangeItalic + hi! link @parameter.reference DraculaOrange + hi! link @field DraculaOrange + hi! link @constructor DraculaCyan " # Keywords - hi! link TSLabel DraculaPurpleItalic + hi! link @label DraculaPurpleItalic " # Variable - hi! link TSVariableBuiltin DraculaPurpleItalic + hi! link @variable.builtin DraculaPurpleItalic " # Text - hi! link TSStrong DraculaFgBold - hi! link TSEmphasis DraculaFg - hi! link TSUnderline Underlined - hi! link TSTitle DraculaYellow - hi! link TSLiteral DraculaYellow - hi! link TSURI DraculaYellow + hi! link @text.strong DraculaFgBold + hi! link @text.emphasis DraculaFg + hi! link @text.underline Underlined + hi! link @text.title DraculaYellow + hi! link @text.literal DraculaYellow + hi! link @text.uri DraculaYellow " HTML and JSX tag attributes. By default, this group is linked to TSProperty, " which in turn links to Identifer (white). - hi! link TSTagAttribute DraculaGreenItalic + hi! link @tag.attribute DraculaGreenItalic endif " }}} " nvim-cmp: {{{ From 3431d5c7474d5b10c058091f7d16f8fd1c66d229 Mon Sep 17 00:00:00 2001 From: yuys13 Date: Mon, 17 Oct 2022 23:44:06 +0900 Subject: [PATCH 2/5] Add default values lost due to breaking changes in nvim-treesitter --- after/plugin/dracula.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index 3f60596..0522642 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -69,31 +69,46 @@ endif " https://github.com/nvim-treesitter/nvim-treesitter/blob/master/plugin/nvim-treesitter.vim if exists('g:loaded_nvim_treesitter') " # Misc + hi! link @punctuation.delimiter Delimiter + hi! link @punctuation.bracket Normal hi! link @punctuation.special Special " # Constants + hi! link @constant Constant + hi! link @constant.builtin Constant hi! link @constant.macro Macro + hi! link @string.regex String hi! link @string.escape Character hi! link @symbol DraculaPurple hi! link @annotation DraculaYellow hi! link @attribute DraculaGreenItalic + hi! link @namespace Structure " # Functions hi! link @function.builtin DraculaCyan hi! link @funcion.macro Function hi! link @parameter DraculaOrangeItalic hi! link @parameter.reference DraculaOrange hi! link @field DraculaOrange + hi! link @property Normal hi! link @constructor DraculaCyan " # Keywords hi! link @label DraculaPurpleItalic + hi! link @keyword.function DraculaCyan + hi! link @keyword.operator Operator + hi! link @exception DraculaPurple " # Variable + hi! link @variable Normal hi! link @variable.builtin DraculaPurpleItalic " # Text + hi! link @text Normal hi! link @text.strong DraculaFgBold hi! link @text.emphasis DraculaFg hi! link @text.underline Underlined hi! link @text.title DraculaYellow hi! link @text.literal DraculaYellow hi! link @text.uri DraculaYellow + " # Tags + hi! link @tag DraculaCyan + hi! link @tag.delimiter Normal " HTML and JSX tag attributes. By default, this group is linked to TSProperty, " which in turn links to Identifer (white). hi! link @tag.attribute DraculaGreenItalic From ed78f2f6b1a1a6343033c91770e3bdfef15313d4 Mon Sep 17 00:00:00 2001 From: yuys13 Date: Tue, 18 Oct 2022 00:36:49 +0900 Subject: [PATCH 3/5] Restore TS* highlight groups --- after/plugin/dracula.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index 0522642..981096a 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -68,6 +68,38 @@ endif " specification. " https://github.com/nvim-treesitter/nvim-treesitter/blob/master/plugin/nvim-treesitter.vim if exists('g:loaded_nvim_treesitter') + " deplicated TS* highlight groups + " see https://github.com/nvim-treesitter/nvim-treesitter/pull/3656 + " # Misc + hi! link TSPunctSpecial Special + " # Constants + hi! link TSConstMacro Macro + hi! link TSStringEscape Character + hi! link TSSymbol DraculaPurple + hi! link TSAnnotation DraculaYellow + hi! link TSAttribute DraculaGreenItalic + " # Functions + hi! link TSFuncBuiltin DraculaCyan + hi! link TSFuncMacro Function + hi! link TSParameter DraculaOrangeItalic + hi! link TSParameterReference DraculaOrange + hi! link TSField DraculaOrange + hi! link TSConstructor DraculaCyan + " # Keywords + hi! link TSLabel DraculaPurpleItalic + " # Variable + hi! link TSVariableBuiltin DraculaPurpleItalic + " # Text + hi! link TSStrong DraculaFgBold + hi! link TSEmphasis DraculaFg + hi! link TSUnderline Underlined + hi! link TSTitle DraculaYellow + hi! link TSLiteral DraculaYellow + hi! link TSURI DraculaYellow + " HTML and JSX tag attributes. By default, this group is linked to TSProperty, + " which in turn links to Identifer (white). + hi! link TSTagAttribute DraculaGreenItalic + " # Misc hi! link @punctuation.delimiter Delimiter hi! link @punctuation.bracket Normal From 84adf19f1d75a8073eb75a9a15cd499fb0917762 Mon Sep 17 00:00:00 2001 From: yuys13 Date: Tue, 18 Oct 2022 12:52:11 +0900 Subject: [PATCH 4/5] Add version check for neovim Add compatibility with older neovim to support older version of nvim-treesitter --- after/plugin/dracula.vim | 90 ++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index 981096a..95e4fd3 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -100,50 +100,52 @@ if exists('g:loaded_nvim_treesitter') " which in turn links to Identifer (white). hi! link TSTagAttribute DraculaGreenItalic - " # Misc - hi! link @punctuation.delimiter Delimiter - hi! link @punctuation.bracket Normal - hi! link @punctuation.special Special - " # Constants - hi! link @constant Constant - hi! link @constant.builtin Constant - hi! link @constant.macro Macro - hi! link @string.regex String - hi! link @string.escape Character - hi! link @symbol DraculaPurple - hi! link @annotation DraculaYellow - hi! link @attribute DraculaGreenItalic - hi! link @namespace Structure - " # Functions - hi! link @function.builtin DraculaCyan - hi! link @funcion.macro Function - hi! link @parameter DraculaOrangeItalic - hi! link @parameter.reference DraculaOrange - hi! link @field DraculaOrange - hi! link @property Normal - hi! link @constructor DraculaCyan - " # Keywords - hi! link @label DraculaPurpleItalic - hi! link @keyword.function DraculaCyan - hi! link @keyword.operator Operator - hi! link @exception DraculaPurple - " # Variable - hi! link @variable Normal - hi! link @variable.builtin DraculaPurpleItalic - " # Text - hi! link @text Normal - hi! link @text.strong DraculaFgBold - hi! link @text.emphasis DraculaFg - hi! link @text.underline Underlined - hi! link @text.title DraculaYellow - hi! link @text.literal DraculaYellow - hi! link @text.uri DraculaYellow - " # Tags - hi! link @tag DraculaCyan - hi! link @tag.delimiter Normal - " HTML and JSX tag attributes. By default, this group is linked to TSProperty, - " which in turn links to Identifer (white). - hi! link @tag.attribute DraculaGreenItalic + if has('nvim-0.8') + " # Misc + hi! link @punctuation.delimiter Delimiter + hi! link @punctuation.bracket Normal + hi! link @punctuation.special Special + " # Constants + hi! link @constant Constant + hi! link @constant.builtin Constant + hi! link @constant.macro Macro + hi! link @string.regex String + hi! link @string.escape Character + hi! link @symbol DraculaPurple + hi! link @annotation DraculaYellow + hi! link @attribute DraculaGreenItalic + hi! link @namespace Structure + " # Functions + hi! link @function.builtin DraculaCyan + hi! link @funcion.macro Function + hi! link @parameter DraculaOrangeItalic + hi! link @parameter.reference DraculaOrange + hi! link @field DraculaOrange + hi! link @property Normal + hi! link @constructor DraculaCyan + " # Keywords + hi! link @label DraculaPurpleItalic + hi! link @keyword.function DraculaCyan + hi! link @keyword.operator Operator + hi! link @exception DraculaPurple + " # Variable + hi! link @variable Normal + hi! link @variable.builtin DraculaPurpleItalic + " # Text + hi! link @text Normal + hi! link @text.strong DraculaFgBold + hi! link @text.emphasis DraculaFg + hi! link @text.underline Underlined + hi! link @text.title DraculaYellow + hi! link @text.literal DraculaYellow + hi! link @text.uri DraculaYellow + " # Tags + hi! link @tag DraculaCyan + hi! link @tag.delimiter Normal + " HTML and JSX tag attributes. By default, this group is linked to TSProperty, + " which in turn links to Identifer (white). + hi! link @tag.attribute DraculaGreenItalic + endif endif " }}} " nvim-cmp: {{{ From 08c8c4bb7f579244bda592f463a4891bd8c98db7 Mon Sep 17 00:00:00 2001 From: yuys13 Date: Tue, 25 Oct 2022 00:37:16 +0900 Subject: [PATCH 5/5] fix typo --- after/plugin/dracula.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index 95e4fd3..7057188 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -68,7 +68,7 @@ endif " specification. " https://github.com/nvim-treesitter/nvim-treesitter/blob/master/plugin/nvim-treesitter.vim if exists('g:loaded_nvim_treesitter') - " deplicated TS* highlight groups + " deprecated TS* highlight groups " see https://github.com/nvim-treesitter/nvim-treesitter/pull/3656 " # Misc hi! link TSPunctSpecial Special