SnipKit - Snippet CLI manager
SnipKit aims to paste code snippets from your favorite snippet manager into your terminal without even leaving it.
This repository is still in the early stages of development! Use at your own risk.
As of now, only SnippetsLab is supported. Other CLI managers may be added in the future.
Documentation
Quick Start
Overview of all commands
snipkit -h
Configuration
# Create a new config
snipkit config init
If you have SnippetsLab installed, the config should already point to the corresponding
library file.
You can open & edit the config file easily:
snipkit config edit
Have a look at the various configuration options. They should be self-explanatory
most of the time.
Power Setup
Alias
Always typing the full name snipkit
in order to open the manager might be too
cumbersome for you. Just define an alias (e.g. in your .zshrc
file):
# SnipKit alais
sn () {
snipkit $1
}
Then you can just type sn
instead of snipkit
to open the app.
Default Root Command
Most of the time, you want to call the same subcommand, e.g. print
or exec
. You
can configure snipkit
so that this command gets executed by default by editing the config:
Example:
# snipkit config edit
defaultRootCommand: "exec"
With this setup, calling sn
will yield the same result as snipkit exec
. If you want to call
the print
command instead, just type sn print
.
Features
snipkit
supports the following features:
- Load snippets form an external snippet manager (filtered by tags)
- SnippetsLab
- File system directory
- Parameter substitution
- Enum parameters
- Search for snippets by typing
- Root command can be adjusted (e.g. set to
print
or exec
)
- Themes
- Built-in themes (
default
, dracula
, solarized-light
, example
)
- Define custom themes
Installation
Homebrew
brew install lemoony/tap/snipkit
apt
echo 'deb [trusted=yes] https://apt.fury.io/lemoony/ /' | sudo tee /etc/apt/sources.list.d/fury.list
sudo apt update
sudo apt install snipkit
Go
go install github.com/lemoony/snipkit@latest
Build
https://github.com/lemoony/snipkit.git
cd snipkit
make build
After the build succeeds, go to ./dist
to find the binary for your operating system.
Features and bugs
Please file feature requests and bugs at the issue tracker.