From eca6b060539218fdc2d3aa01d934440b2090bfa2 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 22 Jan 2024 15:29:18 +1100 Subject: [PATCH 1/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 28 ++++++++++++++++++---------- lua/nvim-tree/appearance.lua | 16 +++++++--------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 4a4dee03612..9c21715ff03 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -846,7 +846,7 @@ Value can be `"none"`, `"icon"`, `"name"` or `"all"`. *nvim-tree.renderer.highlight_opened_files* Highlight icons and/or names for |bufloaded()| files using the -`NvimTreeOpenedFile` highlight group. +`NvimTreeOpenedHL` highlight group. See |nvim-tree-api.navigate.opened.next()| and |nvim-tree-api.navigate.opened.prev()| Value can be `"none"`, `"icon"`, `"name"` or `"all"`. Type: `string`, Default: `"none"` @@ -2266,11 +2266,10 @@ Standard: > NvimTreeStatusLineNC StatusLineNC < File Text: > - NvimTreeExecFile Constant - NvimTreeImageFile PreProc - NvimTreeOpenedFile Constant - NvimTreeSpecialFile PreProc - NvimTreeSymlink Statement + NvimTreeExecFile WinBar + NvimTreeImageFile WinBar + NvimTreeSpecialFile WinBar + NvimTreeSymlink WinBar < Folder Text: > NvimTreeRootFolder PreProc @@ -2282,7 +2281,6 @@ Folder Text: > File Icons: > NvimTreeFileIcon NvimTreeNormal NvimTreeSymlinkIcon NvimTreeNormal - NvimTreeOpenedFileIcon NvimTreeOpenedFile < Folder Icons: > NvimTreeFolderIcon guifg=#8094b4 ctermfg=Blue @@ -2306,16 +2304,16 @@ Clipboard: > NvimTreeCutHL SpellBad < Bookmarks: > - NvimTreeBookmarkIcon Constant + NvimTreeBookmarkIcon SpecialKey NvimTreeBookmarkHL SpellLocal < Modified: > - NvimTreeModifiedIcon Constant + NvimTreeModifiedIcon Type NvimTreeModifiedFileHL NvimTreeModifiedIcon NvimTreeModifiedFolderHL NvimTreeModifiedIcon < Opened: > - NvimTreeOpenedHL Constant + NvimTreeOpenedHL Special < Git Icon: > NvimTreeGitDeletedIcon Statement @@ -2377,6 +2375,16 @@ Diagnostics Folder Highlight: > - `highlight_xxx` is additive instead of overwriting. See |nvim-tree-opts-renderer| for precedence. +2024-01-22: disambiguate highlights sharing groups: + +- NvimTreeModified* Constant -> Type +- NvimTreeOpenedHL Constant -> Special +- NvimTreeBookmarkIcon Constant -> SpecialKey +- NvimTreeExecFile Constant -> WinBar +- NvimTreeImageFile PreProc -> WinBar +- NvimTreeSpecialFile PreProc -> WinBar +- NvimTreeSymlink Statement -> WinBar + Legacy highlight group are still obeyed when they are defined and the current highlight group is not, hard linking as follows: > diff --git a/lua/nvim-tree/appearance.lua b/lua/nvim-tree/appearance.lua index d744a92e310..7c89e7c3033 100644 --- a/lua/nvim-tree/appearance.lua +++ b/lua/nvim-tree/appearance.lua @@ -32,11 +32,10 @@ local DEFAULT_LINKS = { NvimTreeStatusLineNC = "StatusLineNC", -- File Text - NvimTreeExecFile = "Constant", - NvimTreeImageFile = "PreProc", - NvimTreeOpenedFile = "Constant", - NvimTreeSpecialFile = "PreProc", - NvimTreeSymlink = "Statement", + NvimTreeExecFile = "WinBar", + NvimTreeImageFile = "WinBar", + NvimTreeSpecialFile = "WinBar", + NvimTreeSymlink = "WinBar", -- Folder Text NvimTreeRootFolder = "PreProc", @@ -48,7 +47,6 @@ local DEFAULT_LINKS = { -- File Icons NvimTreeFileIcon = "NvimTreeNormal", NvimTreeSymlinkIcon = "NvimTreeNormal", - NvimTreeOpenedFileIcon = "NvimTreeOpenedFile", -- Folder Icons NvimTreeOpenedFolderIcon = "NvimTreeFolderIcon", @@ -68,16 +66,16 @@ local DEFAULT_LINKS = { NvimTreeCopiedHL = "SpellRare", -- Bookmark - NvimTreeBookmarkIcon = "Constant", + NvimTreeBookmarkIcon = "SpecialKey", NvimTreeBookmarkHL = "SpellLocal", -- Modified - NvimTreeModifiedIcon = "Constant", + NvimTreeModifiedIcon = "Type", NvimTreeModifiedFileHL = "NvimTreeModifiedIcon", NvimTreeModifiedFolderHL = "NvimTreeModifiedFileHL", -- Opened - NvimTreeOpenedHL = "Constant", + NvimTreeOpenedHL = "Special", -- Git Icon NvimTreeGitDeletedIcon = "Statement", From aca63cad8fe9e4ca155a16cb76311dec9ff3326d Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 22 Jan 2024 16:21:22 +1100 Subject: [PATCH 2/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 16 ++++++++-------- lua/nvim-tree/appearance.lua | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 9c21715ff03..99eaa457d83 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -2266,10 +2266,10 @@ Standard: > NvimTreeStatusLineNC StatusLineNC < File Text: > - NvimTreeExecFile WinBar - NvimTreeImageFile WinBar - NvimTreeSpecialFile WinBar - NvimTreeSymlink WinBar + NvimTreeExecFile ModeMsg + NvimTreeImageFile ModeMsg + NvimTreeSpecialFile ModeMsg + NvimTreeSymlink ModeMsg < Folder Text: > NvimTreeRootFolder PreProc @@ -2380,10 +2380,10 @@ Diagnostics Folder Highlight: > - NvimTreeModified* Constant -> Type - NvimTreeOpenedHL Constant -> Special - NvimTreeBookmarkIcon Constant -> SpecialKey -- NvimTreeExecFile Constant -> WinBar -- NvimTreeImageFile PreProc -> WinBar -- NvimTreeSpecialFile PreProc -> WinBar -- NvimTreeSymlink Statement -> WinBar +- NvimTreeExecFile Constant -> ModeMsg +- NvimTreeImageFile PreProc -> ModeMsg +- NvimTreeSpecialFile PreProc -> ModeMsg +- NvimTreeSymlink Statement -> ModeMsg Legacy highlight group are still obeyed when they are defined and the current highlight group is not, hard linking as follows: > diff --git a/lua/nvim-tree/appearance.lua b/lua/nvim-tree/appearance.lua index 7c89e7c3033..7feea8e77b3 100644 --- a/lua/nvim-tree/appearance.lua +++ b/lua/nvim-tree/appearance.lua @@ -32,10 +32,10 @@ local DEFAULT_LINKS = { NvimTreeStatusLineNC = "StatusLineNC", -- File Text - NvimTreeExecFile = "WinBar", - NvimTreeImageFile = "WinBar", - NvimTreeSpecialFile = "WinBar", - NvimTreeSymlink = "WinBar", + NvimTreeExecFile = "ModeMsg", + NvimTreeImageFile = "ModeMsg", + NvimTreeSpecialFile = "ModeMsg", + NvimTreeSymlink = "ModeMsg", -- Folder Text NvimTreeRootFolder = "PreProc", From 72f3cdb5157aaed0ced71e8aff55dcd10ba75008 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 22 Jan 2024 16:21:30 +1100 Subject: [PATCH 3/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 99eaa457d83..fd06ebe0384 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -2240,11 +2240,19 @@ groups. Example |:highlight| > :hi NvimTreeSymlink guifg=blue gui=bold,underline < -It is recommended to enable 'termguicolors' for the more pleasant 24-bit colours. +It is recommended to enable 'termguicolors' for the more pleasant 24-bit +colours. To view the active highlight groups run `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight| +The `*HL` groups are additive as per |nvim-tree-opts-renderer| precedence. +Only present attributes will clobber each other. +In this example a modified, opened file will have magenta text, with cyan +squigglies: > + :hi NvimTreeOpenedHL guifg=magenta guisp=red gui=underline + :hi NvimTreeModifiedFileHL guisp=cyan gui=undercurl +< Default linked group or definition follows name. Standard: > From 332435e549f8253772bd2c448c6841ac12b39262 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 22 Jan 2024 17:12:48 +1100 Subject: [PATCH 4/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index fd06ebe0384..1735ad83037 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -46,7 +46,8 @@ CONTENTS *nvim-tree* 7. Mappings |nvim-tree-mappings| 7.1 Mappings: Default |nvim-tree-mappings-default| 8. Highlight |nvim-tree-highlight| - 8.1 Highlight Overhaul |nvim-tree-highlight-overhaul| + 8.1 Highlight Default |nvim-tree-highlight-default| + 8.2 Highlight Overhaul |nvim-tree-highlight-overhaul| 9. Events |nvim-tree-events| 10. Prompts |nvim-tree-prompts| 11. OS Specific Restrictions |nvim-tree-os-specific| @@ -2253,7 +2254,16 @@ squigglies: > :hi NvimTreeOpenedHL guifg=magenta guisp=red gui=underline :hi NvimTreeModifiedFileHL guisp=cyan gui=undercurl < -Default linked group or definition follows name. +To prevent usage of a highlight: +- Before setup: link the group to `Normal` e.g. + `:hi NvimTreeExecFile Normal` +- After setup: link it to `NONE`, to override the default link e.g. + `:hi! link NvimTreeExecFile NONE` + +============================================================================== + 8.1 HIGHLIGHT DEFAULT *nvim-tree-highlight-default* + +|:highlight-link| `default` or |:highlight-default| define the groups on setup: Standard: > NvimTreeNormal Normal From 1a7cb44eb19ea9eaeb8139415046f61047f6a3ac Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Tue, 23 Jan 2024 10:13:37 +1100 Subject: [PATCH 5/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 3 ++- lua/nvim-tree/appearance.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 1735ad83037..2cd0007efd9 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -2290,7 +2290,7 @@ File Text: > NvimTreeSymlink ModeMsg < Folder Text: > - NvimTreeRootFolder PreProc + NvimTreeRootFolder Title NvimTreeFolderName Directory NvimTreeEmptyFolderName Directory NvimTreeOpenedFolderName Directory @@ -2395,6 +2395,7 @@ Diagnostics Folder Highlight: > 2024-01-22: disambiguate highlights sharing groups: +- NvimTreeRootFolder PreProc -> Title - NvimTreeModified* Constant -> Type - NvimTreeOpenedHL Constant -> Special - NvimTreeBookmarkIcon Constant -> SpecialKey diff --git a/lua/nvim-tree/appearance.lua b/lua/nvim-tree/appearance.lua index 7feea8e77b3..ddb3b65c535 100644 --- a/lua/nvim-tree/appearance.lua +++ b/lua/nvim-tree/appearance.lua @@ -38,7 +38,7 @@ local DEFAULT_LINKS = { NvimTreeSymlink = "ModeMsg", -- Folder Text - NvimTreeRootFolder = "PreProc", + NvimTreeRootFolder = "Title", NvimTreeFolderName = "Directory", NvimTreeEmptyFolderName = "Directory", NvimTreeOpenedFolderName = "Directory", From 3652a83f63f51e4194598788592fcf2f49eff633 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 29 Jan 2024 12:34:55 +1100 Subject: [PATCH 6/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 14 +++++++------- lua/nvim-tree/appearance.lua | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 2cd0007efd9..62def664038 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -2250,7 +2250,7 @@ as per |:highlight| The `*HL` groups are additive as per |nvim-tree-opts-renderer| precedence. Only present attributes will clobber each other. In this example a modified, opened file will have magenta text, with cyan -squigglies: > +undercurl: > :hi NvimTreeOpenedHL guifg=magenta guisp=red gui=underline :hi NvimTreeModifiedFileHL guisp=cyan gui=undercurl < @@ -2393,16 +2393,16 @@ Diagnostics Folder Highlight: > - `highlight_xxx` is additive instead of overwriting. See |nvim-tree-opts-renderer| for precedence. -2024-01-22: disambiguate highlights sharing groups: +2024-01-29: disambiguate default highlights sharing groups: - NvimTreeRootFolder PreProc -> Title - NvimTreeModified* Constant -> Type - NvimTreeOpenedHL Constant -> Special -- NvimTreeBookmarkIcon Constant -> SpecialKey -- NvimTreeExecFile Constant -> ModeMsg -- NvimTreeImageFile PreProc -> ModeMsg -- NvimTreeSpecialFile PreProc -> ModeMsg -- NvimTreeSymlink Statement -> ModeMsg +- NvimTreeBookmarkIcon Constant -> NvimTreeFolderIcon +- NvimTreeExecFile Constant -> SpellCap +- NvimTreeImageFile PreProc -> SpellCap +- NvimTreeSpecialFile PreProc -> SpellCap +- NvimTreeSymlink Statement -> SpellCap Legacy highlight group are still obeyed when they are defined and the current highlight group is not, hard linking as follows: > diff --git a/lua/nvim-tree/appearance.lua b/lua/nvim-tree/appearance.lua index ddb3b65c535..574c1e0f5fa 100644 --- a/lua/nvim-tree/appearance.lua +++ b/lua/nvim-tree/appearance.lua @@ -32,10 +32,10 @@ local DEFAULT_LINKS = { NvimTreeStatusLineNC = "StatusLineNC", -- File Text - NvimTreeExecFile = "ModeMsg", - NvimTreeImageFile = "ModeMsg", - NvimTreeSpecialFile = "ModeMsg", - NvimTreeSymlink = "ModeMsg", + NvimTreeExecFile = "SpellCap", + NvimTreeImageFile = "SpellCap", + NvimTreeSpecialFile = "SpellCap", + NvimTreeSymlink = "SpellCap", -- Folder Text NvimTreeRootFolder = "Title", @@ -66,7 +66,7 @@ local DEFAULT_LINKS = { NvimTreeCopiedHL = "SpellRare", -- Bookmark - NvimTreeBookmarkIcon = "SpecialKey", + NvimTreeBookmarkIcon = "NvimTreeFolderIcon", NvimTreeBookmarkHL = "SpellLocal", -- Modified From 816a0dada8b06b11a4aa78d7ac439ac3bd4a9fc9 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 29 Jan 2024 12:38:37 +1100 Subject: [PATCH 7/7] fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul --- doc/nvim-tree-lua.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 62def664038..920a3ac3689 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -2284,10 +2284,10 @@ Standard: > NvimTreeStatusLineNC StatusLineNC < File Text: > - NvimTreeExecFile ModeMsg - NvimTreeImageFile ModeMsg - NvimTreeSpecialFile ModeMsg - NvimTreeSymlink ModeMsg + NvimTreeExecFile SpellCap + NvimTreeImageFile SpellCap + NvimTreeSpecialFile SpellCap + NvimTreeSymlink SpellCap < Folder Text: > NvimTreeRootFolder Title @@ -2322,7 +2322,7 @@ Clipboard: > NvimTreeCutHL SpellBad < Bookmarks: > - NvimTreeBookmarkIcon SpecialKey + NvimTreeBookmarkIcon NvimTreeFolderIcon NvimTreeBookmarkHL SpellLocal < Modified: >