Skip to content

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

License

Notifications You must be signed in to change notification settings

marqmitk/codesnap.nvim

 
 

Repository files navigation

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 :)

Screen.Recording.2024-02-21.at.20.23.26.mov

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, -- 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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 34.2%
  • Rust 30.1%
  • Lua 18.8%
  • CSS 7.7%
  • HTML 5.6%
  • Python 2.4%
  • Other 1.2%