08f0b24cf4
* [Update] apply template * [Feat] update assets files (#35) * [Update] README add packer install config * [Feat] take snapshot via skia engine * [Feat] title component * [Feat] add watermark * [Feat] update padding of code panel * [Remove] pack ci script * [Release] v1.0.0 * [Update] apply template * [Chore] remove unused code * [Update] readme * [Release] v1.0.1 * [Update] apply template * [Update] readme * Update README.md * [Feat] compile nvim-0.9 FFI * [Release] v1.0.2 * [Update] apply template * [Update] README.md * [Feat] add multi platform support * [Feat] add workflow for build target binary package * [Update] files based on generated files by template generator * [Update] files based on generated files by template generator * [Update] files based on generated files by template generator * [Update] files based on generated files by template generator * [Update] files based on generated files by template generator * [Update] files based on generated files by template generator * [Update] files based on generated files by template generator * [Feat] build plugin after released * [Delete] build.yml * [Update] README * [Release] v1.0.3 * [Update] README * [Refactor] editor frame size calculation logic * [Refactor] update margin of watermark * [Feat] preset font family * [Refactor] update component interface * [Update] change theme to onedark * [Refactor] redefine render_error and throw it to lua scope * [Perf] build script * [Refactor] abstract component concept & implement it for all widgets * [Update] README.md --------- Co-authored-by: mistricky <mistricky@users.noreply.github.com> |
||
---|---|---|
.cargo | ||
.github/workflows | ||
assets | ||
doc | ||
generator | ||
lua | ||
plugin | ||
scripts | ||
template/doc | ||
.gitignore | ||
commitlint.config.js | ||
LICENSE | ||
makefile | ||
project.toml | ||
README.md | ||
stylua.toml |
CodeSnap.nvim
📸 Snapshot plugin that can make pretty code snapshots with real-time previews for Neovim
Warning
v1.0.0 will bring some break changes
- The
CodeSnapPreviewOn
command is not supported, if you prefer live-preview, you can pinCodeSnap.nvim
version tov0.0.11
to continue using this command.- The
opacity
andpreview_title
config has been removed from v1.0.0- The
editor_font_family
was renamed tocode_font_family
✨Features
- 🤩 Beautiful code snap template
- 😎 Custom watermark and window style
- 💻 Beautiful Mac-style title bar
- 🤖 Generate snapshots using only a single command
- 👏 [WIP] Custom template background
- 🔢 [WIP] Column number
- 🍞 [WIP] Breadcrumbs
Prerequirements
- Neovim 9.0+
Install
Recommend using Lazy.nvim for installation, but you can still use another plugin manager you prefer.
Lazy.nvim
{ "mistricky/codesnap.nvim", build = "make", version = "^1" },
Build manually
Since v0.0.1 was released, the CodeSnap.nvim will cross-compile for the following three targets, then the CodeSnap.nvim will automatically determine which package to use based on your system, you no longer need to have Rust environment if everything goes smoothly.
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
If CodeSnap.nvim on your system still not works fine, there are a lot of reasons depending on your system arch or OS version, well you can try to build CodeSnap manually using the following config:
{ "mistricky/codesnap.nvim", build = "make build_generator", version = "^1" },
Usage
CodeSnap.nvim
provides the following two ways to take snapshots of currently selected code
Copy into the clipboard
To take a beautiful snapshot use CodeSnap.nvim, you can just use CodeSnap
command to generate a snapshot of the current selected code, then the CodeSnap.nvim
will write the snapshot into the clipboard, and you can paste it anywhere you want.
https://github.com/mistricky/codesnap.nvim/assets/22574136/88d9fe9e-d938-4d82-a1e4-b7170ca47dd9
Save the snapshot
Of course, you can use CodeSnapSave
command to save the snapshot to path where you defined it in config.save_path
require("codesnap").setup({
-- ...
save_path: ...
})
https://github.com/mistricky/codesnap.nvim/assets/22574136/7b156a89-1e0d-48cd-b062-af5a460973ba
Watermark
Watermark is something that makes screenshots more personalized, but if you don't like watermark just set it as empty string to hide it.
require("codesnap").setup({
-- ...
watermark: ""
})
Commands
CodeSnap # Take a snapshot of the currently selected code and copy the snapshot into the clipboard
CodeSnapSave # Save the snapshot of the currently selected code and save it on the disk
Configuration
Define your custom config using setup
function
require("codesnap").setup({...})
There is a default config:
{
mac_window_bar = true,
title = "CodeSnap.nvim",
code_font_family = "CaskaydiaCove Nerd Font",
watermark_font_family = "Pacifico",
watermark = "CodeSnap.nvim",
}
License
MIT.