mini.icons
doesnt work with nvim-tree
sometimes...
#1540
-
Contributing guidelines
Module(s)mini.icons Questionminiicons.mp4
return {
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeFindFileToggle", "NvimTreeOpen", "NvimTreeClose", "NvimTreeFindFile" },
version = "*",
lazy = false,
priority = 2000,
dependencies = {
{ "echasnovski/mini.icons" },
{ "b0o/nvim-tree-preview.lua", lazy = true },
},
keys = { { "<C-n>", "<cmd>NvimTreeFindFileToggle!<cr>", desc = "Toggle Nvim Tree" } },
enabled = vim.g.filebrowser == 1 or vim.g.filebrowser == 2,
init = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- ...
_autocmd("VimResized", "*", function()
if view.is_visible() then
view.close()
tree.open()
end
end, _augroup("NvimTreeResize"), false)
end,
opts = { update_focused_file = { enable = true, update_root = { enable = true } } },
}
{
"echasnovski/mini.icons",
version = false,
lazy = false,
priority = 1000,
specs = {
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true },
},
init = function()
package.preload["nvim-web-devicons"] = function()
_require("mini.icons", "Couldn't mock nvim-web-devicons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
_require("mini.icons", "Error setting up icons").setup(
_require("NeutronVim.plugins.configs.icons", "Error loading icons setup table")
)
end,
}, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Sorry, it doesn't look like a 'mini.icons' issue. Doing a plain |
Beta Was this translation helpful? Give feedback.
-
so like theres no workaround for directly loading mini.icons first? i was fiddling with specific file icons, @echasnovski any idea why this: doesnt work? ["lazy.lua"] = { glyph = "", hl = "MiniIconsAzure" },
["bootstrap.lua"] = { glyph = "", hl = "MiniIconsRed" },
["packer.lua"] = { glyph = "", hl = "MiniIconsOrange" },
["pckr.lua"] = { glyph = "", hl = "MiniIconsYellow" },
["autocmd.lua"] = { glyph = "", hl = "MiniIconsYellow" },
["health.lua"] = { glyph = "", "MiniIconsGreen" },
["treesitter.lua"] = { glyph = "", "MiniIconsGreen" }, here, |
Beta Was this translation helpful? Give feedback.
Sorry, it doesn't look like a 'mini.icons' issue. Doing a plain
require('mini.icons).setup()
followed byMiniIcons.mock_nvim_web_devicons()
explicitly before loading 'nvim-tree/nvim-tree' should make it work consistently. Supporting manual (and kind of tricky) lazy loading is out of scope for 'mini.icons'.