Closed samEngineering closed 1 year ago
You can override an individual icon via API: https://github.com/nvim-tree/nvim-web-devicons#set-an-icon
That's what I tried first, but the result of that was no icon at all. My full config at that time was
local status, devicons = pcall(require, "nvim-web-devicons")
if not status then
return
end
devicons.setup({
color_icons = true,
default = true,
override = {
r = { icon="ﳒ", color=Green, name="R" },
py = { icon="", color=Yellow, name="Python" },
},
})
devicons.set_icon {
man = { icon="", color="#428850", cterm_color=65, name="Man" },
}
I also tried recalling this from my color scheme as suggested in the readme, but I still get nothing for the man icon.
Is this an nvim-web-devicons issue or a bufferline issue?
Please try:
:lua print(vim.inspect(require("nvim-web-devicons").get_icon("something.c")))
then try man
The inspect command returns the correct icon for c (""
), man page still not showing any icon with the config above.
Other icons work for bufferline, so I think this might be an nvim-web-devicons issue. I thought it might have been related to using the man
command with the MANPAGER
environment variable as described in the original post, but I get the same result if I run :Man <...>
from within nvim
. I hope this helps.
I tried with your configuration above:
---
print("c " .. vim.inspect(require("nvim-web-devicons").get_icon("something.c")))
print("man " .. vim.inspect(require("nvim-web-devicons").get_icon("something.man")))
print("man " .. vim.inspect(require("nvim-web-devicons").get_icon("man")))
I don't know what to say; it looks to be working as intended.
The inspect command returns the correct icon for c ("")
Did it work for man?
Yes, those commands work with man
as intended for me as well. This must be something weird happening with bufferline
then. Strange that it doesn't work only for the man
file type. I will continue trying to debug with the bufferline
author. Thanks for your help!
It might be an ordering issue between bufferline and webdevicons, or bufferline caching.
I like to use nvim as my manpager via the environment variable
export MANPAGER="nvim +Man! -c ':set signcolumn=auto'"
and in my devicons config I have
I've tried a few different icons and colors but always get the default icon. The
man
filetype can be verified while viewing a man page with:echo &ft
Is it possible to override the default icon in this case? Great job on this plugin!