-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: show filetype and filetype icon and lsp name in statusline #2211
feat: show filetype and filetype icon and lsp name in statusline #2211
Conversation
1fc35ca
to
78c3f02
Compare
What about if there are multiple LSPs active (in possible future updates)? |
yes, multiple LSPs currrently not supported, but I think it could be supported with minor updates. future updates currently not supported. actully I did not take much time to investigate the code about how the statusline is rendered and updated. |
Is the statusline currently configurable? I think using the langauge icons might cause issues for people who don't use fonts that include them. |
yes, unicode emoji will be a problem for user who don't have an emoji font. so I think it is better if the statusline is configurable. a simple config will be a boolean item, which allow user to enable this feature. but this config maybe not flexiable but I think maybe we can use something like starlark, so the user can define his own |
Beyond devicons there is also nerd fonts , which is a superset. I think it's relatively common to have support for it via a toggle. I think it would be a good approach here to include the info on the status line and check a global toggle for nerd fonts. Then we can show icons not just here but in various other places as well. |
I never got nerd fonts to work, I really don't like them! I instead use: https://github.com/microsoft/vscode-codicons and they work out great, no need to patch anything. They look like this in Neovim: |
I would prefer to only show the language name/scope - the icons seem unnecessary to me and that they need a patched font doesn't help. Plus https://github.com/kyazdani42/nvim-web-devicons is not licensed so I don't know where it stands on distributing the |
as for the license issue, I do not think this could be a problem. we could create yes, need a patched font, this is something not perfect, but for most users, this should not be a big problem. |
Requiring patched or custom fonts to properly display in an editor is an automatic ❌ for something built in or available out of the box. Similar to #649 (comment) I'd like to see this be a part of statusline config so users can add it in if they want but it's off by default since a language name + icon are redundant most of the time. It's going to be hard to add this with just the toml config though. |
fwiw, I really like the icons, but I agree that it should be opt-in. |
Should we close this in favor of #2434? |
@the-mikedavis I'll close this PR now. but I still do not like the implementation of static config fields like #2434 I think if we could use some script, like lua or starlark to config the statusline. the idea is expose statusline related api to the script lang, and then let the script to config and build the final statusline. in that way, user can have their own filetype emoji or do anything we can not do now, as it does not depend on the helix Rust code anymore. |
I'd like to show filetype and filetype icon and lsp name in statusline
is there better way to do this?
maybe more flexiable way, using a language like starlark ?
ft_icons.toml
is auto generated via a lua script (lua gen.lua > ft_icons.toml
) which mainly get the icons via https://github.com/kyazdani42/nvim-web-devicons/blob/master/lua/nvim-web-devicons.luagen.lua
here's the demo: