https://github.com/tymekdev/freeze.nvim
Take code screenshots with freeze straight from Neovim
https://github.com/tymekdev/freeze.nvim
neovim neovim-plugin nvim
Last synced: 11 months ago
JSON representation
Take code screenshots with freeze straight from Neovim
- Host: GitHub
- URL: https://github.com/tymekdev/freeze.nvim
- Owner: TymekDev
- License: mit
- Created: 2024-07-11T20:34:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T09:16:44.000Z (over 1 year ago)
- Last Synced: 2025-07-10T14:59:07.954Z (11 months ago)
- Topics: neovim, neovim-plugin, nvim
- Language: Lua
- Homepage:
- Size: 5.86 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# freeze.nvim
A plugin wrapping [`freeze`](https://github.com/charmbracelet/freeze) into a `:Freeze` command.
## Requirements
- Neovim >= 0.10.0
- MacOS and `osascript`
- `freeze` >= [`578e9d0`](https://github.com/charmbracelet/freeze/commit/578e9d05c3196241fa3c49ce857f9f4c8ae6a77b) (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
### [lazy.nvim](https://github.com/folke/lazy.nvim)
_Annotations are optional._
```lua
---@module "lazy"
---@type LazySpec
{
"TymekDev/freeze.nvim",
cmd = "Freeze",
---@module "freeze"
---@type freeze.Options
opts = {},
}
```
Once installed, you can run a health check with:
```vim
:Lazy load freeze.nvim | checkhealth freeze
```
> [!TIP]
> Use [lazydev.nvim](https://github.com/folke/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.
```lua
{
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](https://github.com/TymekDev/dotfiles), so I decided to turn it into a standalone plugin.