Update generated neovim config
This commit is contained in:
@ -173,6 +173,17 @@ use {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "",
|
||||
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,
|
||||
-- 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 = "*",
|
||||
|
||||
@ -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 = "[+] ",
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash
|
||||
#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
Reference in New Issue
Block a user