Skip to content

Commit

Permalink
feat(mini-icons): add neo-tree.nvim integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Sep 6, 2024
1 parent 331bf6f commit 1a80524
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lua/astrocommunity/icon/mini-icons/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ return {
lazy = true,
specs = {
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true },
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
default_component_configs = {
icon = {
provider = function(icon, node)
local text, hl
local mini_icons = require "mini.icons"
if node.type == "file" then
text, hl = mini_icons.get("file", node.name)
elseif node.type == "directory" then
text, hl = mini_icons.get("directory", node.name)
if node:is_expanded() then text = nil end
end

if text then icon.text = text end
if hl then icon.highlight = hl end
end,
},
kind_icon = {
provider = function(icon, node)
icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name)
end,
},
},
},
},
},
init = function()
package.preload["nvim-web-devicons"] = function()
Expand Down

0 comments on commit 1a80524

Please sign in to comment.