📸 Snapshot plugin with rich features that can make pretty code snapshots for Neovim
 
 
 
 
 
 
Go to file
Mist 7963b3f2cc
[Feat] add preview_title option to configure preview page title (#20)
* [Feat] add preview_title option

* [Update] add preview_title option in document
2024-02-24 18:26:03 +08:00
.github/workflows [Feat] change the trigger way of release action (#12) 2024-02-23 21:17:33 +08:00
doc [Update] apply template 2024-02-23 13:24:57 +00:00
lua/codesnap [Feat] add preview_title option to configure preview page title (#20) 2024-02-24 18:26:03 +08:00
plugin Fixed not updating (#6) 2024-02-23 15:37:39 +08:00
scripts Initial commit 2024-02-13 14:05:36 +08:00
snap-client [Feat] add preview_title option to configure preview page title (#20) 2024-02-24 18:26:03 +08:00
snap-server [Feat] add preview_title option to configure preview page title (#20) 2024-02-24 18:26:03 +08:00
template/doc Initial commit 2024-02-13 14:05:36 +08:00
.gitignore [Feat] add preview_title option to configure preview page title (#20) 2024-02-24 18:26:03 +08:00
LICENSE [Add] Create LICENSE 2024-02-21 21:03:43 +08:00
README.md [Feat] add preview_title option to configure preview page title (#20) 2024-02-24 18:26:03 +08:00
commitlint.config.js Initial commit 2024-02-13 14:05:36 +08:00
makefile [Feat] add build script 2024-02-21 19:29:19 +08:00
project.toml [Release] v0.0.8 (#14) 2024-02-23 21:24:44 +08:00
stylua.toml Initial commit 2024-02-13 14:05:36 +08:00

README.md

image

Neovim made with lua release action status release action status

CodeSnap.nvim

📸 Snapshot plugin that can make pretty code snapshots with real-time previews for Neovim

[!NOTE] This plugin is currently in its early stages and may have some bugs, please feel free to submit issues and PRs.

Features

  • 🔥 Real-time preview
  • 🤩 Beautiful code snap template
  • 😎 Custom watermark and window style
  • 💻 Mac style title bar
  • 👏 [WIP] Custom template background
  • 🤖 [WIP] Generate snapshot just one command

Prerequirements

  • Rust environment required for compiling codesnap.nvim plugin server source code, visit Install Rust for more detail.
  • NPM required for build preview source code, visit Install Nodejs for more detail.

Install

{ "mistricky/codesnap.nvim", build = "make" },

Usage

For take a screenshot, the codesnap.nvim provides a command named CodeSnapPreviewOn to open the preview page, and then you can switch to visual mode and select code you want, and finally just click the copy button on the preview page, that's all :)

https://github.com/mistricky/codesnap.nvim/assets/22574136/5e1a023e-142f-49e8-b24f-707da3728fd5

Commands

CodeSnapPreviewOn # Open preview page

-- The following commands are planned but not implemented yet. (welcome PR :))
CodeSnap # Take a code snap and copy it into the clipboard

Configuration

Define your custom config using setup function

require("codesnap").setup({...})

There is a default config:

{
    mac_window_bar = true,-- (Optional) MacOS style title bar switch
    opacity = true, -- (Optional) The code snap has some opacity by default, set it to false for 100% opacity 
    watermark = "CodeSnap.nvim" -- (Optional) you can custom your own watermark, but if you don't like it, just set it to ""
    preview_title = "CodeSnap.nvim" -- (Optional) preview page title
}

License

MIT.