Image Preview Extra
ui.image-preview enables Snacks image rendering. It can preview image files and
render supported document images in terminals that understand the Kitty graphics
protocol.
Enable it
-- ~/.config/blak/lua/blak/user.luareturn { extras = { enabled = { "ui.image-preview", }, },}Or enable it interactively:
:BlakExtras enable ui.image-previewWhat it adds
| Surface | Contribution |
|---|---|
| Snacks | image.enabled = true |
| Terminal support | Kitty, Ghostty, WezTerm, and tmux passthrough where available |
| External tools | ImageMagick for conversion of non-PNG formats |
Configure image rendering
Add Snacks image options under snacks.image:
return { extras = { enabled = { "ui.image-preview" }, }, snacks = { image = { force = false, doc = { enabled = true, inline = true, float = true, max_width = 80, max_height = 40, }, img_dirs = { "img", "images", "assets", "static", "public" }, }, },}If inline rendering behaves poorly in your terminal, keep previews in floats:
return { extras = { enabled = { "ui.image-preview" }, }, snacks = { image = { doc = { inline = false, float = true, }, }, },}Terminal notes
Snacks can auto-detect supported terminals. If your environment is unusual, set one of Snacks’ environment flags before launching Neovim:
SNACKS_GHOSTTY=true blakFor tmux, make sure passthrough is enabled if images do not display.
Verify it
Run:
:checkhealth snacks:BlakDoctorThen open a PNG or a Markdown file with an image reference.