make linking of default groups for tree style and add docs

This commit is contained in:
kiyan42
2020-04-03 11:50:14 +02:00
parent 658e2100eb
commit c003626dee
7 changed files with 26 additions and 8 deletions

View File

@@ -32,9 +32,15 @@ local HIGHLIGHTS = {
GitStaged = { fg = colors.green },
GitMerge = { fg = colors.orange },
GitRenamed = { fg = colors.purple },
GitNew = { fg = colors.yellow },
GitNew = { fg = colors.yellow }
}
EndOfBuffer = { fg = 'bg' }
local LINKS = {
Normal = 'Normal',
EndOfBuffer = 'EndOfBuffer',
CursorLine = 'CursorLine',
VertSplit = 'VertSplit',
CursorColumn = 'CursorColumn'
}
local function init_colors()
@@ -42,6 +48,10 @@ local function init_colors()
local gui = d.gui or 'NONE'
vim.api.nvim_command('hi def LuaTree'..k..' gui='..gui..' guifg='..d.fg)
end
for k, d in pairs(LINKS) do
vim.api.nvim_command('hi def link LuaTree'..k..' '..d)
end
end
return {

View File

@@ -26,6 +26,7 @@ local colors = {
orange = get('terminal_color_11', 'Orange'),
dark_red = get('terminal_color_9', 'DarkRed'),
}
return {
SHOW_FOLDER_ICON = SHOW_FOLDER_ICON,
SHOW_FILE_ICON = SHOW_FILE_ICON,

View File

@@ -71,7 +71,7 @@ local function open()
api.nvim_command('vertical resize '..WIN_WIDTH)
api.nvim_win_set_buf(0, buf)
api.nvim_command('setlocal winhighlight=EndOfBuffer:LuaTreeEndOfBuffer')
api.nvim_command('setlocal winhighlight=EndOfBuffer:LuaTreeEndOfBuffer,Normal:LuaTreeNormal,CursorLine:LuaTreeCursorLine,VertSplit:LuaTreeVertSplit')
for _, opt in pairs(BUF_OPTIONS) do
api.nvim_command('setlocal '..opt)
end