Skip to content

Conversation

classabbyamp
Copy link
Contributor

simply adds/updates user-defined filetypes to the internal filetypes table.

fixes #406

@alex-courtis alex-courtis changed the title feat: support setting icon by filetype feat(#406): add set_icon_by_filetype Mar 1, 2024
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for present and missing cases:

local devicons = require("nvim-web-devicons")

local toml_icon_before = devicons.get_icon_by_filetype("toml")

devicons.set_icon_by_filetype({ toml = "bmp", foo = "bar" })

local toml_icon_after = require("nvim-web-devicons").get_icon_by_filetype("toml")
local foo_icon = require("nvim-web-devicons").get_icon_by_filetype("foo")

print(string.format("toml: %s -> %s, foo: %s", toml_icon_before, toml_icon_after, foo_icon))

simply adds/updates user-defined filetypes to the internal filetypes
table.

fixes #406
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your contribution!

@alex-courtis alex-courtis merged commit 69fb193 into nvim-tree:master Mar 2, 2024
@classabbyamp classabbyamp deleted the set-icon-by-filetype branch March 2, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to add/override icons for filetypes

2 participants