From 030defdb6522f5f716d8201d20ca1a2baa57ca66 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Tue, 20 Feb 2024 13:24:37 +1100 Subject: [PATCH] docs: add highlight examples to quickstart, document pre-overhaul SpellCap groups (#2680) * docs: add highlight examples to quickstart, document pre-overhaul SpellLocal groups * docs: add highlight examples to quickstart * docs: document pre-overhaul SpellCap groups * docs: document pre-overhaul SpellCap groups --- README.md | 17 +++++++++++++++++ doc/nvim-tree-lua.txt | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0985d40b..bc4983c8 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,23 @@ require("nvim-tree").setup { } ``` +### Highlight + +Run `:NvimTreeHiTest` to show all the highlights that nvim-tree uses. + +They can be customised before or after setup is called and will be immediately +applied at runtime. e.g. + +```lua +vim.cmd([[ + :hi NvimTreeExecFile guifg=#ffa0a0 + :hi NvimTreeSpecialFile guifg=#ff80ff gui=underline + :hi NvimTreeSymlink guifg=Yellow gui=italic + :hi link NvimTreeImageFile Title +]]) +``` +See [:help nvim-tree-highlight](doc/nvim-tree-lua.txt) for details. + ## Commands See [:help nvim-tree-commands](doc/nvim-tree-lua.txt) diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index ced571f1..241f4458 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -238,8 +238,15 @@ via |nvim-tree.on_attach| e.g. > Run |:NvimTreeHiTest| to show all the highlights that nvim-tree uses. They can be customised before or after setup is called and will be immediately -applied at runtime. +applied at runtime. e.g. > + vim.cmd([[ + :hi NvimTreeExecFile guifg=#ffa0a0 + :hi NvimTreeSpecialFile guifg=#ff80ff gui=underline + :hi NvimTreeSymlink guifg=Yellow gui=italic + :hi link NvimTreeImageFile Title + ]]) +< See |nvim-tree-highlight| for details. ============================================================================== @@ -2444,6 +2451,15 @@ Diagnostics Folder Highlight: > - NvimTreeSpecialFile PreProc -> SpellCap - NvimTreeSymlink Statement -> SpellCap +Approximate pre-overhaul values for the `SpellCap` groups may be set via: > + + vim.cmd([[ + :hi NvimTreeExecFile gui=bold guifg=#ffa0a0 + :hi NvimTreeSymlink gui=bold guifg=#ffff60 + :hi NvimTreeSpecialFile gui=bold,underline guifg=#ff80ff + :hi NvimTreeImageFile gui=bold guifg=#ff80ff + ]]) +< Legacy highlight group are still obeyed when they are defined and the current highlight group is not, hard linking as follows: >