Skip to content

Commit

Permalink
feat!: Replace nvim-web-devicons with mini.icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed Jul 4, 2024
1 parent f5430bb commit 83c4dd5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
6 changes: 0 additions & 6 deletions lua/core/plugins/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ end
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = {
{
"nvim-tree/nvim-web-devicons",
lazy = true,
},
},
opts = vim.tbl_deep_extend("force", default_options, (user_conf.opts or {})),
config = function(_, opts)
(user_conf.config_function or default_config_function)(opts)
Expand Down
38 changes: 38 additions & 0 deletions lua/core/plugins/mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,42 @@ return {
}
end,
},

{
"echasnovski/mini.icons",
lazy = true,
opts = {},
commit = "b5e40acb2f0de7127bbcf026f3a0a55189a428a4",
init = function()
-- From https://github.com/LazyVim/LazyVim/blob/5115b585e7df4cedb519734ffc380b7e48a366f1/lua/lazyvim/util/mini.lua
package.preload["nvim-web-devicons"] = function()
local Icons = require("mini.icons")
local ret = {}
package.loaded["nvim-web-devicons"] = ret
Icons.mock_nvim_web_devicons()

local function get(cat)
local all = {}
for _, name in ipairs(Icons.list(cat)) do
local icon, color = ret.get_icon_color(cat == "file" and name, cat == "extension" and name)
all[name] = { icon = icon, color = color }
end
return all
end

ret.get_icons_by_extension = function()
return get("extension")
end

ret.get_icons_by_filename = function()
return get("file")
end

ret.get_icons = function()
return vim.tbl_extend("force", get("file"), get("extension"))
end
return ret
end
end,
},
}
1 change: 0 additions & 1 deletion lua/core/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local M = {
cmd = "Neotree",
dependencies = {
"nvim-lua/plenary.nvim",
{ "nvim-tree/nvim-web-devicons", lazy = true },
{ "MunifTanjim/nui.nvim", lazy = true },
{
"s1n7ax/nvim-window-picker",
Expand Down
1 change: 0 additions & 1 deletion lua/core/plugins/oil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local conf = vim.g.config.plugins.oil
return {
"stevearc/oil.nvim",
enabled = conf.enable,
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = conf.opts,
config = function(_, opts)
conf.key_mappings()
Expand Down
1 change: 0 additions & 1 deletion lua/core/plugins/trouble.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ return {
{
"folke/trouble.nvim",
event = "VeryLazy",
dependencies = { "nvim-tree/nvim-web-devicons" },
enabled = config.enabled,
opts = config.opts,
keys = config.keys,
Expand Down

0 comments on commit 83c4dd5

Please sign in to comment.