snipkit

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

SnipKit - Snippet CLI manager

Language build License Go Report Card codecov

SnipKit aims to paste code snippets from your favorite snippet manager into your terminal without even leaving it.

Demo

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.

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL