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(#406): add set_icon_by_filetype #407

Merged
merged 1 commit into from
Mar 2, 2024
Merged

feat(#406): add set_icon_by_filetype #407

merged 1 commit into from
Mar 2, 2024

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))

README.md Outdated Show resolved Hide resolved
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
4 checks passed
@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