From 6a184bfc8438c76a9813cf7bce6d58c97157ea0d Mon Sep 17 00:00:00 2001 From: Mist Date: Wed, 21 Feb 2024 21:01:18 +0800 Subject: [PATCH] [Update] README.md --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e93197..cd566f4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -

Nvim Plugin Template

- +![image](https://github.com/mistricky/codesnap.nvim/assets/22574136/c8982b8c-c273-4257-9fef-f0f9134fd9a1)

Neovim @@ -11,3 +10,58 @@ 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](https://www.rust-lang.org/tools/install) for more detail. +- NPM required for build preview source code, visit [Install Nodejs](https://nodejs.org/en) for more detail. + +## Install +```lua +{ "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 +```shell +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 +```lua +require("codesnap.nvim").setup({...}) +``` + +There is a default config: +```lua +{ + mac_window_bar = true, -- MacOS style title bar switch + opacity = true, -- 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 nil +} +``` + +## License +MIT.