What
lua/config/image.lua uses vim.ui.img.set() to display images — a pre-stable Neovim API flagged as fragile in issue #254. snacks.nvim (already installed and set up in lua/config/plugin_config.lua) ships a stable snacks.image module that provides the same capability with proper terminal-protocol detection.
Where
lua/config/image.lua — entire file (4 lines, never called)
lua/config/plugin_config.lua — snacks setup block (lines 424–446)
Why it matters
Issue #254 correctly identified vim.ui.img as a pre-stable internal API that can shift or disappear across Neovim versions. That issue left the migration path open. snacks.image fills it: it is a supported, versioned API inside an already-installed dependency, handles terminal detection (Kitty, iTerm2, etc.) automatically, and does not depend on any Neovim internal that could change.
Recommended action
- Enable
image in the existing snacks.setup() call:
snacks.setup({
image = { enabled = true }, -- add this
scroll = { enabled = true },
indent = { ... },
notifier = { ... },
})
- Rewrite
image.lua to use snacks.image:
local snacks_ok, snacks = pcall(require, "snacks")
if not snacks_ok then return end
local function preview_image(path)
snacks.image.hover(path) -- or snacks.image.open(path) depending on desired UX
end
-- Wire up an autocmd or keymap to call preview_image
- Remove the dead
vim.ui.img.set() call entirely.
The snacks.image API supports both hover (transient float) and persistent display modes; see the snacks.nvim docs/image.md for details.
What
lua/config/image.luausesvim.ui.img.set()to display images — a pre-stable Neovim API flagged as fragile in issue #254.snacks.nvim(already installed and set up inlua/config/plugin_config.lua) ships a stablesnacks.imagemodule that provides the same capability with proper terminal-protocol detection.Where
lua/config/image.lua— entire file (4 lines, never called)lua/config/plugin_config.lua— snacks setup block (lines 424–446)Why it matters
Issue #254 correctly identified
vim.ui.imgas a pre-stable internal API that can shift or disappear across Neovim versions. That issue left the migration path open.snacks.imagefills it: it is a supported, versioned API inside an already-installed dependency, handles terminal detection (Kitty, iTerm2, etc.) automatically, and does not depend on any Neovim internal that could change.Recommended action
imagein the existingsnacks.setup()call:image.luato usesnacks.image:vim.ui.img.set()call entirely.The
snacks.imageAPI supports both hover (transient float) and persistent display modes; see the snacks.nvim docs/image.md for details.