Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 1.86 KB

README.md

File metadata and controls

70 lines (51 loc) · 1.86 KB

freeze.nvim

A plugin wrapping freeze into a :Freeze command.

Requirements

  • Neovim >= 0.10.0
  • MacOS and osascript
  • freeze >= 578e9d0 (for tokyonight themes)
  • JetBrainsMono Nerd Font

Note

These are specific requirements that work for me. I don't plan to work on lowering these requirements.

Setup

Annotations are optional.

---@module "freeze"
---@type LazySpec
{
  "TymekDev/freeze.nvim",
  cmd = "Freeze",
  ---@module "freeze"
  ---@type freeze.Options
  opts = {},
}

Once installed, you can run a health check with:

:Lazy load freeze.nvim | checkhealth freeze

Tip

Use lazydev.nvim to get completions based on the annotations.

Usage

  • :Freeze command works either on a selection or on a range
  • Use :%Freeze to screenshot an entire file
  • Use :Freeze to screenshot the current line
  • Provide an argument to change the theme: :Freeze tokyonight_day
    • Valid values are keys of require("freeze.themes")

Options

Important

The goal is to create screenshots with a MacOS feel. That's why customization options are limited.

{
  config = "full",
  ["font.family"] = "JetBrainsMono Nerd Font",
  output = function()
    return vim.fn.tempname() .. ".png"
  end,
  theme = require("freeze.themes").tokyonight_storm,
}

Motivation

There are a few plugins built around freeze already. However, the alternatives don't copy the PNG image into the clipboard properly. Namely, it cannot be pasted as an image (e.g. into a Slack message).

I already had the core implemented in my dotfiles, so I decided to turn it into a standalone plugin.