Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mini-icons): add neo-tree.nvim integration #1195

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading