VS Code code snippet generator

snp

VS Code code snippets generator.

Install

curl -sf https://gobinaries.com/djyde/snp | sh

For Windows users, please download it in release page.

Usage

See my snippets as example.

$ mkdir my-snippets
$ cd my-snippets

$ touch csl.snp
// csl.snp

---
scope: javascript
description: console log
---

console.log($1)
$ snp -u

snp -u would write a code snippet file to your VS Code snippets folder. Then when you type csl in VS Code, the code snippet appear in IntelliSense.

The program only find the files with .snp extension in current working directory.

The .snp file

.snp is just a file with front matter and the snippet code. You should pass at least these attributes:

  • scope
  • description The description of this snippet

The file name would become the snippet prefix (the trigger text).

For the snippet syntax, you should see the VS Code Docs

CLI Options

$ snp --help

Usage of snp:
  -p	Should print out the json text
  -u	Should automatically update snippet file in VS Code
  -v	Print version

-p

Instead of updating the file on VS Code snippets folder, you could use -p to just print out the JSON and then use this output to do what you want, like output to a file:

snp -p > my-snippet.code-snippets

Build

go install

go build
Owner
Randy
Love coding. Twitter: @randyloop
Randy
Similar Resources

DND-magic-item-Generator - D&D magic item generator like in Diablo

DND-magic-item-Generator D&D magic item generator like in Diablo Legendary items

Mar 28, 2022

Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.

Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.

Clean-Swift source & test code auto generator Overview Run Output Basic Usage make config.yaml target_project_name: Miro // target project name copyri

Apr 13, 2022

Code generator that generates boilerplate code for a go http server

http-bootstrapper This is a code generator that uses go templates to generate a bootstrap code for a go http server. Usage Generate go http server cod

Nov 20, 2021

Versatile Go code generator.

Versatile Go code generator.

Generis Versatile Go code generator. Description Generis is a lightweight code preprocessor adding the following features to the Go language : Generic

Nov 30, 2022

Jennifer is a code generator for Go

Jennifer Jennifer is a code generator for Go. package main import ( "fmt" . "github.com/dave/jennifer/jen" ) func main() { f := NewFile("m

Jan 4, 2023

XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator

xgen Introduction xgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This li

Jan 1, 2023

A code generator that turns plain old Go services into RPC-enabled (micro)services with robust HTTP APIs.

Frodo Frodo is a code generator and runtime library that helps you write RPC-enabled (micro) services and APIs. It parses the interfaces/structs/comme

Dec 16, 2022

A code generator that turns plain old Go services into RPC-enabled (micro)services with robust HTTP APIs.

Frodo is a code generator and runtime library that helps you write RPC-enabled (micro) services and APIs.

Dec 16, 2022

Jennifer is a code generator for Go

Jennifer Jennifer is a code generator for Go. package main import ( "fmt" . "github.com/dave/jennifer/jen" ) func main() { f := NewFile("m

Dec 25, 2022

golang auto wire code generator

Go-AutoWire helps you to generate wire files with easy annotate 中文文档 this project is base on wire but it did simplify the wire usage and make wire muc

Dec 2, 2022

Roche is a Code Generator and Web Framework, makes web development super concise with Go, CleanArch

Roche is a Code Generator and Web Framework, makes web development super concise with Go, CleanArch

It is still under development, so please do not use it. We plan to release v.1.0.0 in the summer. roche is a web framework optimized for microservice

Sep 19, 2022

Musgo is a Go code generator for binary MUS format with validation support.

Musgo is a Go code generator for binary MUS format with validation support. Generated code converts data to and from MUS format.

Dec 29, 2022

A parser generator where rules defined as go structs and code generation is optional

A parser generator where rules defined as go structs and code generation is optional. The concepts are introduced in the simple example below.

Jul 1, 2022

A code generator base on GORM

GORM/GEN The code generator base on GORM, aims to be developer friendly. Overview CRUD or DIY query method code generation Auto migration from databas

Jan 1, 2023

General Golang Code Generator

gg gg is a General Golang Code Generator: A Good Game to play with Golang. package main import ( "fmt" . "github.com/Xuanwo/gg" ) func main() {

Jan 7, 2023

Default godoc generator - make your first steps towards better code documentation

godoc-generate Overview godoc-generate is a simple command line tool that generates default godoc comments on all exported types, functions, consts an

Sep 14, 2022

OpenAPI Client and Server Code Generator

This package contains a set of utilities for generating Go boilerplate code for services based on OpenAPI 3.0 API definitions

Dec 2, 2022

A prototype code-generator library for golang.

A prototype code-generator library for golang.

Jul 28, 2022

Code generator to produce CLI from R packages

cmd Create command line applications from R packages. How it works It's a code generator that outputs Go code which produces a Command Line Applicatio

Apr 30, 2022
Comments
  • Apple arm m1 chip

    Apple arm m1 chip

    Hi, im was looking for this tool for a long time it is a nice idea and a missing feature in vscode. Unfortunatly im unsing apple m1 chip and i dont see the binaries for this platform. I tryed to install the linux armv8 version without luck. Is on the plans to create the binaries for arm m1 also ?

  • Allow specifying output path

    Allow specifying output path

    Hi, thanks for an useful utility!

    However, it currently has output path hardcoded, which makes it unusable for VS Code Insiders (different path). I know it is possible to generate output file with -p and manually copy it, but why? The whole point of this tool is automation. So let's automate properly.

    Please allow a flag -o (currently commented out in your code) to specify where to output the snippets. Or better yet, allow storing such configuration so it is remembered (.toml/.yaml, ...) between runs.

Related tags
A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.

GoSublime Intro GoSublime is an IDE-like plugin for Sublime Text 3 mainly, but not limited to, providing integration for most of your Go/Golang develo

Jan 4, 2023
Go extension for VS Code
Go extension for VS Code

Go for Visual Studio Code The VS Code Go extension provides rich language support for the Go programming language. Quick Start Welcome! ???? Whether y

Jan 7, 2023
AI-powered code snippet generator using ChatGPT. Generate code in various languages based on natural language descriptions!

SnipForge - AI-Powered Code Snippet Generator SnipForge is a powerful command-line interface (CLI) tool that utilizes OpenAI's GPT technology to gener

May 5, 2023
Snippet CLI manger for quickly using code snippets without leaving the terminal
Snippet CLI manger for quickly using code snippets without leaving the terminal

SnipKit - Snippet CLI manager This repository is still work in progress! SnipKit aims to paste code snippets from your favorite snippet manager into y

Dec 27, 2022
Kana - Simple discord bot for generate code snippet on the fly
Kana - Simple discord bot for generate code snippet on the fly

kana discord bot for generate code snippet on the fly, made with graphene Invite

Jan 25, 2022
Go-web-dev - Web Development With Google's Golang Programming Language Code Snippet and Exercises.

Web Development With Google's Golang Programming Language Code Snippet and Exercises This repository contains my code snippets, hands on exercises and

Jan 16, 2022
Sample code snippet to familiarize golang . Concept of goroutines , channels, concurrency is implemented in a sample scenario

go-mysql-goroutines-channel Sample code snippet to familiarize golang . Concept of goroutines , channels, concurrency , interface, slice, error handli

May 29, 2022
A local snippet manager in Go

Snip A local snippet manager :D Snip provides simple CLI for saving and copying links for emojis, gifs or whatever you want. Requirements Install go i

May 24, 2021
Simple command-line snippet manager, written in Go.
Simple command-line snippet manager, written in Go.

pet : CLI Snippet Manager Simple command-line snippet manager, written in Go You can use variables (<param> or <param=default_value> ) in snippets. Ab

Dec 29, 2022
QOwnNotes command-line snippet manager.
QOwnNotes command-line snippet manager.

QOwnNotes command-line snippet manager GitHub | Changelog | Releases You can use the QOwnNotes command-line snippet manager to execute command snippet

Oct 26, 2022