Closed TroySigX closed 1 year ago
This happens due to the limitations of the neovim terminal, open a new terminal with :new | term
and run viu
inside and the result would be the same, not much I can do about it (that’s why you have to use viu -b
).
You can try chafa
, it works a bit better inside neovim.
Chafa doesn't work for me, it shows like this:
How do I solve it, here's my config:
local img_previewer = { "chafa" }
require("fzf-lua").setup({
previewers = {
builtin = {
ueberzug_scaler = "cover",
extensions = {
["gif"] = img_previewer,
["png"] = img_previewer,
["jpg"] = img_previewer,
["jpeg"] = img_previewer,
},
},
},
})
Does it work if you open a terminal inside neovim with :new | term
and run chafa <image_path.png>
?
It doesn't
It doesn't
Then you have your answer why it doesn’t work within fzf-lua, these media previews are mere suggestions I have no control over how or if they work within the neovim terminal.
Thank you!
If you’re on Linux and use Xorg I recommend ueberzug, it works differently, it spawns an x-window on top of the preview pane, doesn’t use a terminal so it’s not bound by these limitations, will provide the most crisp previews.
It works perfectly, thank you so much!
It works perfectly, thank you so much!
That’s great! Play around with the scaler to get the result you like most, possible options (from the ueberzug project page) are: "crop", "distort", "fit_contain", "contain", "forced_cover" and "cover" (default)
Info
nvim --version
: 0.8.3fzf --version
: latestmini.sh
fzf-lua configuration
```lua require('fzf-lua').setup({ previewers = { builtin = { ueberzug_scaler = "cover", extensions = { ["gif"] = { "viu", "-b" }, ["png"] = { "viu", "-b" }, ["jpg"] = { "viu", "-b" }, ["jpeg"] = { "viu", "-b" }, }, }, }, }) ```Description
Image is very blurry when previewing in fzf-lua, like this:
This is the original image previewed through viu in terminal: