Crates.io | snippy-rs |
lib.rs | snippy-rs |
version | 1.1.0 |
source | src |
created_at | 2024-02-15 20:17:45.40192 |
updated_at | 2024-04-13 16:44:52.810846 |
description | A simple cross-platform CLI tool to manage user-defined snippets. Snippets are loaded and unloaded through the clipboard. |
homepage | |
repository | https://github.com/NicolasChagnet/snippy-rs |
max_upload_size | |
id | 1141520 |
size | 39,829 |
A simple cross-platform CLI tool to manage user-defined snippets written in Rust. Snippets are loaded and unloaded through the clipboard. The snippets are stored in JSON format inside the application folder located inside the default user data folder for the platform. These are obtained through the crate directories:
$HOME/.local/share
for Linux,$HOME/Library/Application Support
for MacOS,%UserProfile%\AppData\Roaming
for Windows.You can install this crate with Cargo by doing
cargo install snippy-rs
You can build this crate from source using the following commands:
> git clone https://github.com/NicolasChagnet/snippy-rs.git
> cd snippy-rs
> cargo build
> cp target/release/snippy /dest/path
In the last command, you can copy the binary to any folder contained in your $PATH
.
NOTE: The crate cli-clipboard requires the libraries xord-dev
and libxcb-composite0-dev
to be built.
To set a new snippet, just run
snippy set NAME DESCRIPTION
The content of the snippet will be pulled from your clipboard and associated with the identifier NAME
. The description is optional.
The various snippets can then be displayed with
snippy
which will start a selector with fuzzy search. Pressing Enter
will copy the snippet's content back to your clipboard while pressing Esc
exits the menu.
A snippet can be removed by using
snippy del
and select the snippet to delete from the menu.
A snippet can be edited using the current clipboard content with
snippy edit
and select the snippet to edit from the menu