freeze.nvim

August 8, 2026 ยท View on GitHub

๐Ÿฆ Screenshot code with freeze from Neovim.

Latest release Last commit License Stars

โœจ Features

  • ๐Ÿ“ธ Screenshot code โ€” Select lines and generate beautiful PNG images
  • ๐Ÿ“‹ Clipboard support โ€” Optionally copy screenshots directly to the system clipboard
  • ๐Ÿ”Œ glaze.nvim integration โ€” Automatic binary management via glaze.nvim
  • ๐ŸŽจ Syntax highlighting โ€” Automatically detects filetype for proper highlighting
  • โšก Zero config โ€” Works out of the box

๐Ÿ“ฆ Installation

lazy.nvim

{
  "taigrr/freeze.nvim",
  dependencies = { "taigrr/glaze.nvim" },
  config = true,
}

packer.nvim

use {
  "taigrr/freeze.nvim",
  requires = { "taigrr/glaze.nvim" },
  config = function()
    require("freeze").setup()
  end,
}

โšก Requirements

  • Neovim >= 0.9.0 (0.10+ recommended)
  • freeze binary (auto-installed via glaze.nvim)
  • glaze.nvim for binary management

๐Ÿš€ Usage

  1. Select lines in visual mode
  2. Run :'<,'>Freeze
  3. A freeze.png will be created in your current working directory

Or freeze the entire buffer:

:Freeze

โš™๏ธ Configuration

require("freeze").setup({
  -- Output directory (default: current working directory)
  -- Missing directories are created automatically
  output = nil,

  -- Output filename (default: "freeze.png")
  filename = "freeze.png",

  -- Freeze theme (default: nil, uses freeze default)
  theme = nil,

  -- Copy image to system clipboard after freeze (default: false)
  -- Supports: xclip, wl-copy (Wayland), xsel (fallback), macOS, WSL
  clipboard = false,

  -- Additional arguments passed to freeze CLI
  extra_args = {},
})

Example: Custom output, theme, and clipboard

require("freeze").setup({
  output = vim.fn.expand("~/screenshots"),
  filename = "code.png",
  theme = "dracula",
  clipboard = true,
  extra_args = { "--padding", "20" },
})

๐Ÿ“– Commands

CommandDescription
:[range]FreezeFreeze selected lines (or entire buffer) to PNG

๐Ÿ“‹ API

local freeze = require("freeze")

-- Setup (called automatically with config = true)
freeze.setup()

-- Freeze specific lines programmatically
freeze.freeze(start_line, end_line)

๐Ÿฉบ Health Check

:checkhealth freeze

Verifies Neovim version, glaze.nvim availability, and freeze binary installation.

  • freeze โ€” The underlying tool
  • glaze.nvim โ€” Go binary manager for Neovim

๐Ÿ“„ License

0BSD ยฉ Tai Groot