add documentation for highlight groups
This commit is contained in:
@@ -34,6 +34,14 @@ let g:lua_tree_show_icons = {
|
|||||||
nnoremap <C-n> :LuaTreeToggle<CR>
|
nnoremap <C-n> :LuaTreeToggle<CR>
|
||||||
nnoremap <leader>r :LuaTreeRefresh<CR>
|
nnoremap <leader>r :LuaTreeRefresh<CR>
|
||||||
nnoremap <leader>n :LuaTreeFindFile<CR>
|
nnoremap <leader>n :LuaTreeFindFile<CR>
|
||||||
|
|
||||||
|
" a list of highlight groups is available at :help nvim-tree-highlight
|
||||||
|
" example configuration:
|
||||||
|
set termguicolors " this variable must be enabled for colors to be applied properly
|
||||||
|
|
||||||
|
highlight LuaTreeFolderName guibg=cyan gui=bold,underline
|
||||||
|
highlight LuaTreeFolderIcon guibg=blue
|
||||||
|
" ...
|
||||||
```
|
```
|
||||||
|
|
||||||
## KeyBindings
|
## KeyBindings
|
||||||
@@ -74,5 +82,4 @@ nnoremap <leader>n :LuaTreeFindFile<CR>
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
- better default colors (use vim highlight groups)
|
- better default colors (use vim highlight groups)
|
||||||
- create proper highlight groups or add highlight function to give the user ability to setup colors themselves
|
|
||||||
- bufferize leafs of node being closed so when opening again the node, we open every directory that was previously open
|
- bufferize leafs of node being closed so when opening again the node, we open every directory that was previously open
|
||||||
|
|||||||
@@ -131,5 +131,49 @@ Git integration tells when a file is:
|
|||||||
|
|
||||||
Mouse support defined in |KeyBindings|
|
Mouse support defined in |KeyBindings|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
HIGHLIGHT GROUPS *nvim-tree-highlight*
|
||||||
|
|
||||||
|
All the following highlight groups can be configured by hand. It is not
|
||||||
|
advised to colorize the background of these groups.
|
||||||
|
|
||||||
|
Example (in your `init.vim`):
|
||||||
|
>
|
||||||
|
highlight LuaTreeSymlink guifg=blue gui=bold,underline
|
||||||
|
<
|
||||||
|
You should have 'termguicolors' enabled, otherwise, colors will not be
|
||||||
|
applied.
|
||||||
|
|
||||||
|
LuaTreeSymlink
|
||||||
|
LuaTreeFolderName
|
||||||
|
LuaTreeFolderIcon
|
||||||
|
LuaTreeExecFile
|
||||||
|
LuaTreeSpecialFile
|
||||||
|
LuaTreeImageFile
|
||||||
|
LuaTreeMarkdownFile
|
||||||
|
|
||||||
|
LuaTreeLicenseIcon
|
||||||
|
LuaTreeYamlIcon
|
||||||
|
LuaTreeTomlIcon
|
||||||
|
LuaTreeGitignoreIcon
|
||||||
|
LuaTreeJsonIcon
|
||||||
|
|
||||||
|
LuaTreeLuaIcon
|
||||||
|
LuaTreePythonIcon
|
||||||
|
LuaTreeShellIcon
|
||||||
|
LuaTreeJavascriptIcon
|
||||||
|
LuaTreeCIcon
|
||||||
|
LuaTreeReactIcon
|
||||||
|
LuaTreeHtmlIcon
|
||||||
|
LuaTreeRustIcon
|
||||||
|
LuaTreeVimIcon
|
||||||
|
LuaTreeTypescriptIcon
|
||||||
|
|
||||||
|
LuaTreeGitDirty
|
||||||
|
LuaTreeGitStaged
|
||||||
|
LuaTreeGitMerge
|
||||||
|
LuaTreeGitRenamed
|
||||||
|
LuaTreeGitNew
|
||||||
|
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
|
||||||
|
|||||||
1
doc/tags
1
doc/tags
@@ -10,6 +10,7 @@ g:lua_tree_side nvim-tree-lua.txt /*g:lua_tree_side*
|
|||||||
g:lua_tree_size nvim-tree-lua.txt /*g:lua_tree_size*
|
g:lua_tree_size nvim-tree-lua.txt /*g:lua_tree_size*
|
||||||
nvim-tree-commands nvim-tree-lua.txt /*nvim-tree-commands*
|
nvim-tree-commands nvim-tree-lua.txt /*nvim-tree-commands*
|
||||||
nvim-tree-features nvim-tree-lua.txt /*nvim-tree-features*
|
nvim-tree-features nvim-tree-lua.txt /*nvim-tree-features*
|
||||||
|
nvim-tree-highlight nvim-tree-lua.txt /*nvim-tree-highlight*
|
||||||
nvim-tree-info nvim-tree-lua.txt /*nvim-tree-info*
|
nvim-tree-info nvim-tree-lua.txt /*nvim-tree-info*
|
||||||
nvim-tree-introduction nvim-tree-lua.txt /*nvim-tree-introduction*
|
nvim-tree-introduction nvim-tree-lua.txt /*nvim-tree-introduction*
|
||||||
nvim-tree-keybindings nvim-tree-lua.txt /*nvim-tree-keybindings*
|
nvim-tree-keybindings nvim-tree-lua.txt /*nvim-tree-keybindings*
|
||||||
|
|||||||
@@ -11,22 +11,22 @@ local HIGHLIGHTS = {
|
|||||||
SpecialFile = { gui = 'bold,underline', fg = colors.yellow },
|
SpecialFile = { gui = 'bold,underline', fg = colors.yellow },
|
||||||
ImageFile = { gui = 'bold', fg = colors.purple },
|
ImageFile = { gui = 'bold', fg = colors.purple },
|
||||||
MarkdownFile = { fg = colors.purple },
|
MarkdownFile = { fg = colors.purple },
|
||||||
LicenseFile = { fg = colors.yellow },
|
LicenseIcon = { fg = colors.yellow },
|
||||||
YamlFile = { fg = colors.yellow },
|
YamlIcon = { fg = colors.yellow },
|
||||||
TomlFile = { fg = colors.yellow },
|
TomlIcon = { fg = colors.yellow },
|
||||||
GitignoreFile = { fg = colors.yellow },
|
GitignoreIcon = { fg = colors.yellow },
|
||||||
JsonFile = { fg = colors.yellow },
|
JsonIcon = { fg = colors.yellow },
|
||||||
|
|
||||||
LuaFile = { fg = '#42a5f5' },
|
LuaIcon = { fg = '#42a5f5' },
|
||||||
PythonFile = { fg = colors.green },
|
PythonIcon = { fg = colors.green },
|
||||||
ShellFile = { fg = colors.green },
|
ShellIcon = { fg = colors.green },
|
||||||
JavascriptFile = { fg = colors.yellow },
|
JavascriptIcon = { fg = colors.yellow },
|
||||||
CFile = { fg = colors.blue },
|
CIcon = { fg = colors.blue },
|
||||||
ReactFile = { fg = colors.cyan },
|
ReactIcon = { fg = colors.cyan },
|
||||||
HtmlFile = { fg = colors.orange },
|
HtmlIcon = { fg = colors.orange },
|
||||||
RustFile = { fg = colors.orange },
|
RustIcon = { fg = colors.orange },
|
||||||
VimFile = { fg = colors.green },
|
VimIcon = { fg = colors.green },
|
||||||
TypescriptFile = { fg = colors.blue },
|
TypescriptIcon = { fg = colors.blue },
|
||||||
|
|
||||||
GitDirty = { fg = colors.dark_red },
|
GitDirty = { fg = colors.dark_red },
|
||||||
GitStaged = { fg = colors.green },
|
GitStaged = { fg = colors.green },
|
||||||
|
|||||||
@@ -87,28 +87,28 @@ local function format_tree(tree)
|
|||||||
return dirs
|
return dirs
|
||||||
end
|
end
|
||||||
|
|
||||||
local HIGHLIGHT_GROUPS = {
|
local HIGHLIGHT_ICON_GROUPS = {
|
||||||
['^LICENSE$'] = 'LicenseFile';
|
['^LICENSE$'] = 'LicenseIcon';
|
||||||
['^%.?vimrc$'] = 'VimFile';
|
['^%.?vimrc$'] = 'VimIcon';
|
||||||
['%.vim$'] = 'VimFile';
|
['%.vim$'] = 'VimIcon';
|
||||||
['%.c$'] = 'CFile';
|
['%.c$'] = 'CIcon';
|
||||||
['%.cpp$'] = 'CFile';
|
['%.cpp$'] = 'CIcon';
|
||||||
['%.cxx$'] = 'CFile';
|
['%.cxx$'] = 'CIcon';
|
||||||
['%.h$'] = 'CFile';
|
['%.h$'] = 'CIcon';
|
||||||
['%.hpp$'] = 'CFile';
|
['%.hpp$'] = 'CIcon';
|
||||||
['%.py$'] = 'PythonFile';
|
['%.py$'] = 'PythonIcon';
|
||||||
['%.lua$'] = 'LuaFile';
|
['%.lua$'] = 'LuaIcon';
|
||||||
['%.rs$'] = 'RustFile';
|
['%.rs$'] = 'RustIcon';
|
||||||
['%.[cz]?sh$'] = 'ShellFile';
|
['%.[cz]?sh$'] = 'ShellIcon';
|
||||||
['%.md$'] = 'MarkdownFile';
|
['%.md$'] = 'MarkdownIcon';
|
||||||
['%.json$'] = 'JsonFile';
|
['%.json$'] = 'JsonIcon';
|
||||||
['%.toml$'] = 'TomlFile';
|
['%.toml$'] = 'TomlIcon';
|
||||||
['%.yml$'] = 'YamlFile';
|
['%.yml$'] = 'YamlIcon';
|
||||||
['%.gitignore$'] = 'GitignoreFile';
|
['%.gitignore$'] = 'GitignoreIcon';
|
||||||
['%.js$'] = 'JavascriptFile';
|
['%.js$'] = 'JavascriptIcon';
|
||||||
['%.ts$'] = 'TypescriptFile';
|
['%.ts$'] = 'TypescriptIcon';
|
||||||
['%.[tj]sx$'] = 'ReactFile';
|
['%.[tj]sx$'] = 'ReactIcon';
|
||||||
['%.html?$'] = 'HtmlFile';
|
['%.html?$'] = 'HtmlIcon';
|
||||||
}
|
}
|
||||||
|
|
||||||
local function highlight_line(buffer)
|
local function highlight_line(buffer)
|
||||||
@@ -141,7 +141,7 @@ local function highlight_line(buffer)
|
|||||||
highlight('LuaTreeImageFile', line, text_start + gitlen, -1)
|
highlight('LuaTreeImageFile', line, text_start + gitlen, -1)
|
||||||
|
|
||||||
elseif config.SHOW_FILE_ICON then
|
elseif config.SHOW_FILE_ICON then
|
||||||
for k, v in pairs(HIGHLIGHT_GROUPS) do
|
for k, v in pairs(HIGHLIGHT_ICON_GROUPS) do
|
||||||
if string.match(node.name, k) ~= nil then
|
if string.match(node.name, k) ~= nil then
|
||||||
text_start = text_start + 4
|
text_start = text_start + 4
|
||||||
highlight('LuaTree' .. v, line, 0, text_start)
|
highlight('LuaTree' .. v, line, 0, text_start)
|
||||||
|
|||||||
Reference in New Issue
Block a user