fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul (#2639)

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul
This commit is contained in:
Alexander Courtis
2024-01-29 12:43:02 +11:00
committed by GitHub
parent fbee8a69a4
commit d9cb432d2c
2 changed files with 49 additions and 24 deletions

View File

@@ -46,7 +46,8 @@ CONTENTS *nvim-tree*
7. Mappings |nvim-tree-mappings| 7. Mappings |nvim-tree-mappings|
7.1 Mappings: Default |nvim-tree-mappings-default| 7.1 Mappings: Default |nvim-tree-mappings-default|
8. Highlight |nvim-tree-highlight| 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| 9. Events |nvim-tree-events|
10. Prompts |nvim-tree-prompts| 10. Prompts |nvim-tree-prompts|
11. OS Specific Restrictions |nvim-tree-os-specific| 11. OS Specific Restrictions |nvim-tree-os-specific|
@@ -846,7 +847,7 @@ Value can be `"none"`, `"icon"`, `"name"` or `"all"`.
*nvim-tree.renderer.highlight_opened_files* *nvim-tree.renderer.highlight_opened_files*
Highlight icons and/or names for |bufloaded()| files using the 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()| See |nvim-tree-api.navigate.opened.next()| and |nvim-tree-api.navigate.opened.prev()|
Value can be `"none"`, `"icon"`, `"name"` or `"all"`. Value can be `"none"`, `"icon"`, `"name"` or `"all"`.
Type: `string`, Default: `"none"` Type: `string`, Default: `"none"`
@@ -2240,12 +2241,29 @@ groups.
Example |:highlight| > Example |:highlight| >
:hi NvimTreeSymlink guifg=blue gui=bold,underline :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` To view the active highlight groups run `:so $VIMRUNTIME/syntax/hitest.vim`
as per |:highlight| as per |:highlight|
Default linked group or definition follows name. 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
undercurl: >
:hi NvimTreeOpenedHL guifg=magenta guisp=red gui=underline
:hi NvimTreeModifiedFileHL guisp=cyan gui=undercurl
<
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: > Standard: >
NvimTreeNormal Normal NvimTreeNormal Normal
@@ -2266,14 +2284,13 @@ Standard: >
NvimTreeStatusLineNC StatusLineNC NvimTreeStatusLineNC StatusLineNC
< <
File Text: > File Text: >
NvimTreeExecFile Constant NvimTreeExecFile SpellCap
NvimTreeImageFile PreProc NvimTreeImageFile SpellCap
NvimTreeOpenedFile Constant NvimTreeSpecialFile SpellCap
NvimTreeSpecialFile PreProc NvimTreeSymlink SpellCap
NvimTreeSymlink Statement
< <
Folder Text: > Folder Text: >
NvimTreeRootFolder PreProc NvimTreeRootFolder Title
NvimTreeFolderName Directory NvimTreeFolderName Directory
NvimTreeEmptyFolderName Directory NvimTreeEmptyFolderName Directory
NvimTreeOpenedFolderName Directory NvimTreeOpenedFolderName Directory
@@ -2282,7 +2299,6 @@ Folder Text: >
File Icons: > File Icons: >
NvimTreeFileIcon NvimTreeNormal NvimTreeFileIcon NvimTreeNormal
NvimTreeSymlinkIcon NvimTreeNormal NvimTreeSymlinkIcon NvimTreeNormal
NvimTreeOpenedFileIcon NvimTreeOpenedFile
< <
Folder Icons: > Folder Icons: >
NvimTreeFolderIcon guifg=#8094b4 ctermfg=Blue NvimTreeFolderIcon guifg=#8094b4 ctermfg=Blue
@@ -2306,16 +2322,16 @@ Clipboard: >
NvimTreeCutHL SpellBad NvimTreeCutHL SpellBad
< <
Bookmarks: > Bookmarks: >
NvimTreeBookmarkIcon Constant NvimTreeBookmarkIcon NvimTreeFolderIcon
NvimTreeBookmarkHL SpellLocal NvimTreeBookmarkHL SpellLocal
< <
Modified: > Modified: >
NvimTreeModifiedIcon Constant NvimTreeModifiedIcon Type
NvimTreeModifiedFileHL NvimTreeModifiedIcon NvimTreeModifiedFileHL NvimTreeModifiedIcon
NvimTreeModifiedFolderHL NvimTreeModifiedIcon NvimTreeModifiedFolderHL NvimTreeModifiedIcon
< <
Opened: > Opened: >
NvimTreeOpenedHL Constant NvimTreeOpenedHL Special
< <
Git Icon: > Git Icon: >
NvimTreeGitDeletedIcon Statement NvimTreeGitDeletedIcon Statement
@@ -2377,6 +2393,17 @@ Diagnostics Folder Highlight: >
- `highlight_xxx` is additive instead of overwriting. See - `highlight_xxx` is additive instead of overwriting. See
|nvim-tree-opts-renderer| for precedence. |nvim-tree-opts-renderer| for precedence.
2024-01-29: disambiguate default highlights sharing groups:
- NvimTreeRootFolder PreProc -> Title
- NvimTreeModified* Constant -> Type
- NvimTreeOpenedHL Constant -> Special
- 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 Legacy highlight group are still obeyed when they are defined and the current
highlight group is not, hard linking as follows: > highlight group is not, hard linking as follows: >

View File

@@ -29,14 +29,13 @@ local DEFAULT_LINKS = {
NvimTreeStatusLineNC = "StatusLineNC", NvimTreeStatusLineNC = "StatusLineNC",
-- File Text -- File Text
NvimTreeExecFile = "Constant", NvimTreeExecFile = "SpellCap",
NvimTreeImageFile = "PreProc", NvimTreeImageFile = "SpellCap",
NvimTreeOpenedFile = "Constant", NvimTreeSpecialFile = "SpellCap",
NvimTreeSpecialFile = "PreProc", NvimTreeSymlink = "SpellCap",
NvimTreeSymlink = "Statement",
-- Folder Text -- Folder Text
NvimTreeRootFolder = "PreProc", NvimTreeRootFolder = "Title",
NvimTreeFolderName = "Directory", NvimTreeFolderName = "Directory",
NvimTreeEmptyFolderName = "Directory", NvimTreeEmptyFolderName = "Directory",
NvimTreeOpenedFolderName = "Directory", NvimTreeOpenedFolderName = "Directory",
@@ -45,7 +44,6 @@ local DEFAULT_LINKS = {
-- File Icons -- File Icons
NvimTreeFileIcon = "NvimTreeNormal", NvimTreeFileIcon = "NvimTreeNormal",
NvimTreeSymlinkIcon = "NvimTreeNormal", NvimTreeSymlinkIcon = "NvimTreeNormal",
NvimTreeOpenedFileIcon = "NvimTreeOpenedFile",
-- Folder Icons -- Folder Icons
NvimTreeOpenedFolderIcon = "NvimTreeFolderIcon", NvimTreeOpenedFolderIcon = "NvimTreeFolderIcon",
@@ -65,16 +63,16 @@ local DEFAULT_LINKS = {
NvimTreeCopiedHL = "SpellRare", NvimTreeCopiedHL = "SpellRare",
-- Bookmark -- Bookmark
NvimTreeBookmarkIcon = "Constant", NvimTreeBookmarkIcon = "NvimTreeFolderIcon",
NvimTreeBookmarkHL = "SpellLocal", NvimTreeBookmarkHL = "SpellLocal",
-- Modified -- Modified
NvimTreeModifiedIcon = "Constant", NvimTreeModifiedIcon = "Type",
NvimTreeModifiedFileHL = "NvimTreeModifiedIcon", NvimTreeModifiedFileHL = "NvimTreeModifiedIcon",
NvimTreeModifiedFolderHL = "NvimTreeModifiedFileHL", NvimTreeModifiedFolderHL = "NvimTreeModifiedFileHL",
-- Opened -- Opened
NvimTreeOpenedHL = "Constant", NvimTreeOpenedHL = "Special",
-- Git Icon -- Git Icon
NvimTreeGitDeletedIcon = "Statement", NvimTreeGitDeletedIcon = "Statement",