Open image files in Neovim as actual images instead of binary garbage. Renders through the kitty graphics protocol, so it works in Ghostty, kitty, and any terminal that implements the protocol.
When you :edit photo.jpg you get a single header line (photo.jpg 1920x1080)
and the image drawn in the window, scaled to fit and centered. No binary text,
no modified buffer, no swap file.
- Neovim 0.10+
- A terminal with kitty graphics protocol support (Ghostty, kitty, WezTerm)
- ImageMagick (
magickorconvert) for non-PNG formats. PNGs work without it.
With lazy.nvim (NvChad uses it):
{
"misaelabanto/imgview.nvim",
lazy = false,
opts = {},
}Or from a local checkout:
{
dir = "~/code/imgview.nvim",
lazy = false,
opts = {},
}Defaults shown:
require("imgview").setup({
-- file extensions handled by the plugin (upper-case variants included)
extensions = { "png", "jpg", "jpeg", "gif", "bmp", "webp", "ico", "avif", "tiff", "tif" },
-- assumed terminal cell width/height ratio, used to fit images to the window
cell_aspect = 0.5,
})-
Animated formats (gif, webp) show their first frame.
-
Conversions are cached in
stdpath("cache")/imgview, keyed by path and mtime. -
tmux is supported: graphics sequences are wrapped in tmux's passthrough envelope automatically. You only need tmux 3.3+ with passthrough enabled in
~/.tmux.conf:set -g allow-passthrough onThe plugin warns once per session if it detects tmux without it. Known limitation of tmux passthrough: switching tmux windows/panes does not erase an already drawn image, so a stale image can linger until the next redraw (
:eor resize re-renders, leaving the buffer clears it).
nvim --headless --clean -l tests/run.lua