-
Notifications
You must be signed in to change notification settings - Fork 179
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: get icons by filetype #125
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b0o
force-pushed
the
get-icon-by-filetype
branch
from
April 22, 2022 05:09
b3c6129
to
59534b7
Compare
b0o
force-pushed
the
get-icon-by-filetype
branch
from
April 22, 2022 08:03
59534b7
to
a897f54
Compare
kyazdani42
approved these changes
Apr 23, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice addition, thanks :)
Great! Should be able to close #29 |
Closed
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Aug 22, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Aug 25, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Sep 8, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Sep 11, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Sep 14, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Oct 5, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Oct 5, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Oct 6, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Oct 19, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Oct 19, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
zappolowski
added a commit
to zappolowski/lualine.nvim
that referenced
this pull request
Oct 22, 2022
With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
shadmansaleh
pushed a commit
to nvim-lualine/lualine.nvim
that referenced
this pull request
Oct 23, 2022
* Refactor tests to use stubs for nvim-web-devicons * Simplify getting icon `get_icon` does not need the 2nd parameter (`ext`) as it will derive it from the given `name` (1st argument) itself. * fix component(filetype) proper icon based on filetype With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes #578
craigmac
pushed a commit
to craigmac/lualine.nvim
that referenced
this pull request
May 15, 2024
* Refactor tests to use stubs for nvim-web-devicons * Simplify getting icon `get_icon` does not need the 2nd parameter (`ext`) as it will derive it from the given `name` (1st argument) itself. * fix component(filetype) proper icon based on filetype With nvim-tree/nvim-web-devicons#125 a filetype based lookup was implemented upstream which can be used to get an icon when a file doesn't have an extension. fixes nvim-lualine#578
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the
filetypes
table, which is a map from vim filetypes to icon names.The map is not exhaustive. More filetypes should be added over time, but at least this is a start.
Also adds the following functions:
Because some icons are not distinguishable by their filetype alone, the filetype table maps to the "most common" or "canonical" icon. E.g. the filetype
cpp
maps to thecpp
icon, even though.hpp
files also have thecpp
filetype.For this reason, users should prefer the standard
get_icon
function if the filename is known; theget_icon_name_by_filetype
function should only be used if the filename is unknown.P.s. if you're interested, I wrote this script to assist in generating the
filetypes
table, and then manually cleaned up the results.Ref #29