A simple CLI utility to manage snippet
This repository has been archived on 2026-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Dandaedre 47c0e64a73 Rewrites the priorities.
Adds two helper function to get the path&name os Pathbuf
2023-05-28 19:11:29 +02:00
coverage/html/badges Updates coverage and version 2023-05-23 21:11:55 +02:00
src Rewrites the priorities. 2023-05-28 19:11:29 +02:00
.gitignore Adds full support for rename and corrects a few bugs 2023-05-23 05:20:03 +02:00
Cargo.toml v1.0.6 2023-05-25 20:26:16 +02:00
LICENSE Initial commit 2023-05-17 11:57:33 +02:00
Makefile.toml Adds full support for rename and corrects a few bugs 2023-05-23 05:20:03 +02:00
README.md Updates readme for new version 2023-05-23 00:27:00 +02:00
TODO.md Rewrites the priorities. 2023-05-28 19:11:29 +02:00

README.md

SNP : A (simple) Code Snippet Manager

coverage/html/badges/flat.svg drawing

Usage

Create and Edit Snippet

To create a new snippet and edit its content immediately, use the following command:

$ snp snippet_name -c -e list_of_default_tokens

Replace snippet_name with the desired name for your snippet and provide a space-separated list_of_default_tokens that you want to include in the snippet. This command will create the snippet and open the editor for you to modify its content.

Edit Snippet Content

To edit the content of an existing snippet, use the following command:

$ snp snippet_name -e

Replace snippet_name with the name of the snippet you want to edit. This command will open the editor for you to modify the content of the specified snippet.

Edit Whole Snippet

To edit the entire snippet, including its name and list of arguments, use the following command:

$ snp snippet_name -E

Replace snippet_name with the name of the snippet you want to edit. This command will open the editor for you to modify the name, content, and arguments of the specified snippet.

Wonky Not definitive behaviour

  • If you change the name of the snippet this way, the snippet will not be saved under a different name, this behaviour will change very soon
  • If you mess up in any way, the snippet manager will save your work under snippet_name.bad.yaml

Delete Snippet

To delete a snippet, use the following command:

$ snp snippet_name -d

Replace snippet_name with the name of the snippet you want to delete. This command will remove the specified snippet from the snippet folder .

Use Snippet

To use a snippet, simply execute the following command:

$ snp snippet_name

Replace snippet_name with the name of the snippet you want to use. This command will execute the specified snippet.

Testing

For testing purposes, it is important to run tests with the optional feature --feature "test". Failing to include this feature may cause the editor to pop up during tests. To run tests, use the following command:

$ cargo test --feature "test"

Make sure to include the --feature "test" option to ensure smooth testing without interruptions from the editor.