Closed sandangel closed 1 year ago
This seems to be coming from the devicons integration, does files
or anything else works normally?
Does :FzfLua blines color_icons=false
works?
@ibhagwan files
and grep
work fine. :FzfLua blines color_icons=false
also work
A few more questions:
lines|blines
work with mini.sh
(wasn't clear to me if you tested from the OP)?:lua _G.dump(require"fzf-lua".utils.ansi_codes)
look somewhat like:
{
DevIconAi = <function 1>,
DevIconAwk = <function 2>,
DevIconBabelrc = <function 3>,
DevIconBash = <function 4>,
DevIconBashProfile = <function 5>,
DevIconBashrc = <function 6>,
DevIconBat = <function 7>,
DevIconBinaryGLTF = <function 8>,
DevIconBmp = <function 9>,
...
}
:lua print(require"fzf-lua".utils.ansi_codes.DevIconLua)
(should print out function: ...
into :messages
):lua print(require"fzf-lua".utils.ansi_codes.DevIcon<Your file extension>)
(e.g. DevIconCpp
)?:lua _G.dump(require"nvim-web-devicons".get_icon("1.lua","lua",{default=true}))
It failed on lua file
Output of lua _G.dump(require"fzf-lua".utils.ansi_codes)
{
black = <function 1>,
blue = <function 2>,
bold = <function 3>,
clear = <function 4>,
cyan = <function 5>,
dark_grey = <function 6>,
green = <function 7>,
grey = <function 8>,
italic = <function 9>,
magenta = <function 10>,
red = <function 11>,
underline = <function 12>,
white = <function 13>,
yellow = <function 14>
}
OUtput of lua print(require"fzf-lua".utils.ansi_codes.DevIconLua)
nil
Does lines|blines work with mini.sh (wasn't clear to me if you tested from the OP)?
You didn't answer this, can you try running sh -c "$(curl -s https://raw.githubusercontent.com/ibhagwan/fzf-lua/main/scripts/mini.sh)"
and tell me if it works?
There's an issue setting up devicon highlights, I'm surprised files
is working for you given there's no file_icons=false
under your setup.files
.
More questions:
:lua _G.dump(require"nvim-web-devicons".get_icon("1.lua","lua",{default=true}))
:lua _G.dump(require"nvim-web-devicons".get_icons())
, should look something like:
{ {
color = "#6d8086",
cterm_color = "66",
icon = "",
name = "Default"
},
[".DS_Store"] = {
color = "#41535b",
cterm_color = "59",
icon = "",
name = "DsStore"
},
...
I think I messed up my icons config
thanks a lot for helping
https://github.com/ibhagwan/fzf-lua/commit/15e9b1f1494dc1facaffe9543281d015c43b9eba - this commits works around your issue by settings the defaults of blines
to no icons/colors (as the file is a hidden field in blines
anyways).
@ibhagwan okay I think I found the issue, there is no DevIconLua
, but there is DevIconlua
. You might want to normalize the word case of devicon.
the right hand side is fzf-lua files
, the left hand side is nvim-tree
. Nvim tree can pickup the icon correctly, but fzf-lua doesn't
vim.g.nvchad_theme = 'onedark'
return {
'nvim-tree/nvim-web-devicons',
dependencies = { { 'NvChad/ui', branch = 'v2.0' }, { 'NvChad/base46', branch = 'v2.0' } },
config = function()
local colors = require('base46').get_theme_tb 'base_30'
local override = vim.tbl_deep_extend('force', require('nvchad_ui.icons').devicons, {
default_icon = { color = colors.red },
c = { color = colors.blue, name = 'C' },
css = { color = colors.blue },
deb = { color = colors.cyan },
Dockerfile = { color = colors.cyan },
html = { color = colors.baby_pink },
jpeg = { color = colors.dark_purple },
jpg = { color = colors.dark_purple },
js = { color = colors.sun },
kt = { color = colors.orange },
lock = { color = colors.red },
lua = { color = colors.blue },
mp3 = { color = colors.white },
mp4 = { color = colors.white },
out = { color = colors.white },
png = { color = colors.dark_purple },
py = { color = colors.cyan },
toml = { color = colors.blue },
ts = { color = colors.teal },
ttf = { color = colors.white },
rb = { color = colors.pink },
rpm = { color = colors.orange },
vue = { color = colors.vibrant_green },
woff = { color = colors.white },
woff2 = { color = colors.white },
xz = { color = colors.sun },
zip = { color = colors.sun },
['robots.txt'] = { color = colors.blue },
['docker-compose.yaml'] = {
icon = '',
name = 'DockerCompose',
color = colors.cyan,
},
['.dockerignore'] = {
icon = '',
name = 'DockerIgnore',
color = colors.cyan,
},
yaml = {
icon = '',
name = 'yaml',
color = colors.orange,
},
hcl = {
icon = '',
color = colors.green,
name = 'hcl',
},
json = {
icon = '',
color = colors.green,
name = 'Json',
},
md = {
icon = '',
color = colors.vibrant_green,
name = 'md',
},
sh = {
icon = '',
color = colors.yellow,
name = 'sh',
},
sql = {
icon = '',
color = colors.red,
name = 'sql',
},
})
require('nvim-web-devicons').setup {
override = override
}
end
}
this is my web-dev-icons
settings using Lazy if you would like to reproduce
the right hand side is fzf-lua files, the left hand side is nvim-tree. Nvim tree can pickup the icon correctly, but fzf-lua doesn't
Nvim-tree gets the neovim highlights directly from devicons, FzfLua can’t do that, it has to recreate a new set of highlight escape codes for the terminal (as fzf runs in the terminal).
@ibhagwan okay I think I found the issue, there is no
DevIconLua
, but there isDevIconlua
. You might want to normalize the word case of devicon.
I thought about it before but this turned out to never be an issue, the issue is just with your setup since you’re overriding the name
property, whats the purpose of doing so?
What if you override the name completely not just change the capitalization? It shouldn’t matter as long as devicons returns the same name from both geticons
and geticon
.
What’s the output of :lua _G.dump(require"nvim-web-devicons".get_icon("1.lua","lua",{default=true}))
? Is it Lua
or lua
?
@ibhagwan I got this one: "" "DevIconlua"
@ibhagwan I got this one: "" "DevIconlua"
Everything is working as expected.
I just tried icon override with devicons and it also works as expected:
require("nvim-web-devicons").setup({
override = {
lua = {
icon = "",
color = "#89e051",
cterm_color = "113",
name = "luaicon",
},
},
})
My lua icons now look like terminal icons, and :lua _G.dump(require"nvim-web-devicons".get_icon("1.lua","lua",{default=true}))
returns: "" "DevIconluaicon"
- the case doesn't need to be normalized and both fzf-lua and devicons are adpating accordingly.
This issue is different than the original issue, you have no lua exceptions, the icons are picked up properly but the icon chosen for docker seems to have a font rendering issue within the neovim terminal (as I wrote above, fzf-lua runs fzf inside a neovim terminal).
Try to change docker to a different icon, for example change it to a
and I expect it will work, figure out why your font doesn't render this icon within the neovim terminal and you'll have your solution.
The issue is devicons
defaults for Dockerfile
contains an icon that's not part of nerd fonts, I suspect you have a custom definition for "special files" in nvim-tree that's why it works, you need to add an override to Dockerfile
to get the result you want:
require("nvim-web-devicons").setup({
override = {
Dockerfile = {
icon = "",
color = "#458ee6",
cterm_color = "33",
name = "Dockerfile",
},
},
})
@ibhagwan
The issue is devicons defaults for Dockerfile contains an icon that's not part of nerd fonts, I suspect you have a custom definition for "special files" in nvim-tree that's why it works
I think this is not correct. I have a code override like you mentioned already in web-devicons config. There is nothing specific.
local override = vim.tbl_deep_extend('force', require('nvchad_ui.icons').devicons, {
default_icon = { color = colors.red },
c = { color = colors.blue, name = 'C' },
css = { color = colors.blue },
deb = { color = colors.cyan },
Dockerfile = { color = colors.cyan } -- <<----- this line
So I just reuse the table defined here and add colors to it using tbl_deep_extend
https://github.com/NvChad/ui/blob/v2.0/lua/nvchad_ui/icons.lua#L44
I also changed the icon to a
but it doesn't work either.
I also open nvim terminal and tried ls
, it also showed dockerfile icon correctly
:lua _G.dump(require"nvim-web-devicons".get_icon("Dockerfile","Dockerfile",{default=true}))
return?a
and see if it works?"" "DevIconDockerfile"
I set icon to letter a
as above and it still doesn't work https://github.com/ibhagwan/fzf-lua/issues/668#issuecomment-1445334818
"" "DevIconDockerfile"
This seems accurate.
I set icon to letter
a
as above and it still doesn't work
I understand your issue now, by default, overrides do not work with providers that use multiprocess
(files
, grep
, etc), as these providers spawn in an external process, if you try lines
(which doesn't run in an external process) you will see it works.
To apply your overrides in the external process read this: https://github.com/ibhagwan/fzf-lua/wiki#how-can-i-use-custom-devicons-with-multiprocess
You'll need to move your devicons overrides to a separate file (with its limitations), see #657, #386, #311.
@sandangel, https://github.com/ibhagwan/fzf-lua/commit/604eadfcf69b90cf9e508767ad217107520ce4d4 - this commits makes my previous post moot, everything should now work as expected including overrides without additional setup.
Let me know if this works as expected now?
okay now it works as expected. thanks a lot for fixing.
okay now it works as expected. thanks a lot for fixing.
Great, ty for the update!
Info
nvim --version
: 0.9.0-devfzf --version
: 0.38I got this error after the latest update. I already reinstall the plugin but still same error
mini.sh
fzf-lua configuration
```lua require('fzf-lua').setup({ keymap = { builtin = { ['Description