Git Product home page Git Product logo

snp's Introduction

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

snp's People

Contributors

djyde avatar daihy8759 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.