1

Update generated neovim config

This commit is contained in:
2024-09-22 20:41:25 +02:00
parent 1743764e48
commit aa1271c42c
1247 changed files with 26512 additions and 15067 deletions

View File

@ -203,7 +203,18 @@ local config = {
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon"
highlight = "NeoTreeFileIcon",
provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available
if node.type == "file" or node.type == "terminal" then
local success, web_devicons = pcall(require, "nvim-web-devicons")
local name = node.type == "terminal" and "terminal" or node.name
if success then
local devicon, hl = web_devicons.get_icon(name)
icon.text = devicon or icon.text
icon.highlight = hl or icon.highlight
end
end
end
},
modified = {
symbol = "[+] ",

View File

@ -291,33 +291,31 @@ M.filtered_by = function(config, node, state)
end
M.icon = function(config, node, state)
local icon = config.default or " "
local highlight = config.highlight or highlights.FILE_ICON
-- calculate default icon
local icon =
{ text = config.default or " ", highlight = config.highlight or highlights.FILE_ICON }
if node.type == "directory" then
highlight = highlights.DIRECTORY_ICON
icon.highlight = highlights.DIRECTORY_ICON
if node.loaded and not node:has_children() then
icon = not node.empty_expanded and config.folder_empty or config.folder_empty_open
icon.text = not node.empty_expanded and config.folder_empty or config.folder_empty_open
elseif node:is_expanded() then
icon = config.folder_open or "-"
icon.text = config.folder_open or "-"
else
icon = config.folder_closed or "+"
end
elseif node.type == "file" or node.type == "terminal" then
local success, web_devicons = pcall(require, "nvim-web-devicons")
local name = node.type == "terminal" and "terminal" or node.name
if success then
local devicon, hl = web_devicons.get_icon(name)
icon = devicon or icon
highlight = hl or highlight
icon.text = config.folder_closed or "+"
end
end
-- use icon provider if available
if config.provider then
icon = config.provider(icon, node, state) or icon
end
local filtered_by = M.filtered_by(config, node, state)
return {
text = icon .. " ",
highlight = filtered_by.highlight or highlight,
}
icon.text = icon.text .. " " -- add padding
icon.highlight = filtered_by.highlight or icon.highlight -- prioritize filtered highlighting
return icon
end
M.modified = function(config, node, state)

View File

@ -15,14 +15,18 @@ local common = require("neo-tree.sources.common.components")
local M = {}
M.icon = function(config, node, state)
return {
M.kind_icon = function(config, node, state)
local icon = {
text = node:get_depth() == 1 and "" or node.extra.kind.icon,
highlight = node.extra and node.extra.kind.hl or highlights.FILE_NAME,
highlight = node.extra.kind.hl,
}
end
M.kind_icon = M.icon
if config.provider then
icon = config.provider(icon, node, state) or icon
end
return icon
end
M.kind_name = function(config, node, state)
return {