Project

snippit

0.0
No release in over a year
Define, store, and output your code snippets
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 0.59
~> 13.0
~> 3.11
~> 1.36
~> 0.21
~> 0.9.28
 Project Readme

Snippit

Gem Version CI CodeQL codecov

Define, store, and output your code snippets.

Usage

All uses of snippit can be replaced with the shortcut snip.

# Define a snippet called "hello-world.js"
$ snippit --save hello-world.js

# Set the slug and descriptive name of the snippet
$ snippit --save hello-world.js --slug hw-js --name "JavaScript Starter"

# Output the "JavaScript Starter" snippet to a file called "index.js"
$ snippit --get hw-js > index.js

# List all of your code snippets
$ snippit --list

How it works

Code snippets get stored in a directory called .snippit in your home directory. The actual code snippet filenames are slugified versions of the snippet name. .__definitions__.yml is a reserved filename, as it is used to map snippet slugs (filenames) to their human-readable names.