-
Notifications
You must be signed in to change notification settings - Fork 185
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
No way to add/override icons for filetypes #406
Comments
this solves my issue diff --git a/lua/nvim-web-devicons.lua b/lua/nvim-web-devicons.lua
index 4301079..d8b6a73 100644
--- a/lua/nvim-web-devicons.lua
+++ b/lua/nvim-web-devicons.lua
@@ -39,7 +39,7 @@ local function refresh_icons()
end
-- Map of filetypes -> icon names
-local filetypes = {
+M.filetypes = {
["avif"] = "avif",
["bzl"] = "bzl",
["brewfile"] = "brewfile",
@@ -437,7 +437,7 @@ function M.get_icon(name, ext, opts)
end
function M.get_icon_name_by_filetype(ft)
- return filetypes[ft]
+ return M.filetypes[ft]
end
function M.get_icon_by_filetype(ft, opts) by allowing me to do would that be an acceptable change to PR? |
That would be great. Let's use a setter Confirmed: no action will be needed in the case of colourscheme change etc. |
but inside the setter, that mechanism is the way to go? |
Yes please - completely override or add. |
the
get_icon_*_by_filetype
api relies on thefiletypes
local, which cannot be extended or modified externally. this makes it impossible to add an icon for a custom filetype, and becauselualine
uses the_by_filetype
api, it cannot use any custom icons.would it be possible to add a
set_icon_by_filetype
or makefiletypes
publicly accessible?The text was updated successfully, but these errors were encountered: