A plugin wrapping freeze
into a :Freeze
command.
- 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.
Annotations are optional.
---@module "lazy"
---@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.
: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")
- Valid values are keys of
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,
}
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.