add documentation for highlight groups
This commit is contained in:
@@ -11,22 +11,22 @@ local HIGHLIGHTS = {
|
||||
SpecialFile = { gui = 'bold,underline', fg = colors.yellow },
|
||||
ImageFile = { gui = 'bold', fg = colors.purple },
|
||||
MarkdownFile = { fg = colors.purple },
|
||||
LicenseFile = { fg = colors.yellow },
|
||||
YamlFile = { fg = colors.yellow },
|
||||
TomlFile = { fg = colors.yellow },
|
||||
GitignoreFile = { fg = colors.yellow },
|
||||
JsonFile = { fg = colors.yellow },
|
||||
LicenseIcon = { fg = colors.yellow },
|
||||
YamlIcon = { fg = colors.yellow },
|
||||
TomlIcon = { fg = colors.yellow },
|
||||
GitignoreIcon = { fg = colors.yellow },
|
||||
JsonIcon = { fg = colors.yellow },
|
||||
|
||||
LuaFile = { fg = '#42a5f5' },
|
||||
PythonFile = { fg = colors.green },
|
||||
ShellFile = { fg = colors.green },
|
||||
JavascriptFile = { fg = colors.yellow },
|
||||
CFile = { fg = colors.blue },
|
||||
ReactFile = { fg = colors.cyan },
|
||||
HtmlFile = { fg = colors.orange },
|
||||
RustFile = { fg = colors.orange },
|
||||
VimFile = { fg = colors.green },
|
||||
TypescriptFile = { fg = colors.blue },
|
||||
LuaIcon = { fg = '#42a5f5' },
|
||||
PythonIcon = { fg = colors.green },
|
||||
ShellIcon = { fg = colors.green },
|
||||
JavascriptIcon = { fg = colors.yellow },
|
||||
CIcon = { fg = colors.blue },
|
||||
ReactIcon = { fg = colors.cyan },
|
||||
HtmlIcon = { fg = colors.orange },
|
||||
RustIcon = { fg = colors.orange },
|
||||
VimIcon = { fg = colors.green },
|
||||
TypescriptIcon = { fg = colors.blue },
|
||||
|
||||
GitDirty = { fg = colors.dark_red },
|
||||
GitStaged = { fg = colors.green },
|
||||
|
||||
@@ -87,28 +87,28 @@ local function format_tree(tree)
|
||||
return dirs
|
||||
end
|
||||
|
||||
local HIGHLIGHT_GROUPS = {
|
||||
['^LICENSE$'] = 'LicenseFile';
|
||||
['^%.?vimrc$'] = 'VimFile';
|
||||
['%.vim$'] = 'VimFile';
|
||||
['%.c$'] = 'CFile';
|
||||
['%.cpp$'] = 'CFile';
|
||||
['%.cxx$'] = 'CFile';
|
||||
['%.h$'] = 'CFile';
|
||||
['%.hpp$'] = 'CFile';
|
||||
['%.py$'] = 'PythonFile';
|
||||
['%.lua$'] = 'LuaFile';
|
||||
['%.rs$'] = 'RustFile';
|
||||
['%.[cz]?sh$'] = 'ShellFile';
|
||||
['%.md$'] = 'MarkdownFile';
|
||||
['%.json$'] = 'JsonFile';
|
||||
['%.toml$'] = 'TomlFile';
|
||||
['%.yml$'] = 'YamlFile';
|
||||
['%.gitignore$'] = 'GitignoreFile';
|
||||
['%.js$'] = 'JavascriptFile';
|
||||
['%.ts$'] = 'TypescriptFile';
|
||||
['%.[tj]sx$'] = 'ReactFile';
|
||||
['%.html?$'] = 'HtmlFile';
|
||||
local HIGHLIGHT_ICON_GROUPS = {
|
||||
['^LICENSE$'] = 'LicenseIcon';
|
||||
['^%.?vimrc$'] = 'VimIcon';
|
||||
['%.vim$'] = 'VimIcon';
|
||||
['%.c$'] = 'CIcon';
|
||||
['%.cpp$'] = 'CIcon';
|
||||
['%.cxx$'] = 'CIcon';
|
||||
['%.h$'] = 'CIcon';
|
||||
['%.hpp$'] = 'CIcon';
|
||||
['%.py$'] = 'PythonIcon';
|
||||
['%.lua$'] = 'LuaIcon';
|
||||
['%.rs$'] = 'RustIcon';
|
||||
['%.[cz]?sh$'] = 'ShellIcon';
|
||||
['%.md$'] = 'MarkdownIcon';
|
||||
['%.json$'] = 'JsonIcon';
|
||||
['%.toml$'] = 'TomlIcon';
|
||||
['%.yml$'] = 'YamlIcon';
|
||||
['%.gitignore$'] = 'GitignoreIcon';
|
||||
['%.js$'] = 'JavascriptIcon';
|
||||
['%.ts$'] = 'TypescriptIcon';
|
||||
['%.[tj]sx$'] = 'ReactIcon';
|
||||
['%.html?$'] = 'HtmlIcon';
|
||||
}
|
||||
|
||||
local function highlight_line(buffer)
|
||||
@@ -141,7 +141,7 @@ local function highlight_line(buffer)
|
||||
highlight('LuaTreeImageFile', line, text_start + gitlen, -1)
|
||||
|
||||
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
|
||||
text_start = text_start + 4
|
||||
highlight('LuaTree' .. v, line, 0, text_start)
|
||||
|
||||
Reference in New Issue
Block a user