1.2.7 • Published 5 months ago
csnp v1.2.7
Install
$ npm i -g csnp
$ yarn i -g csnp
$ pnpm i -g csnp
$ bun i -g csnp
csnp
Using interactive prompts to generate .csnp files for managing code snippets.
Rule csnp path
.csnp/js/log.csnp
match
.csnp/{SnippetType}/{SnippetFileName}.csnp
SnippetType: js
SnippetFileName: log
Details
Open file .csnp/js/log.csnp
and edit the default code snippets.
---
name: Log
prefix: '-log'
description: my snippet description
---
code snippets
The line code snippets
is a default code snippets.
Just edit and replace it of code console.log
.
---
name: Log
prefix: '-log'
description: log sth
---
console.log($1)
After csnp push
, use the prefix -log
in VSCode to generate code.
Result:
.csnp to code-snippets
Transform all *.csnp files and store them locally or globally(VSCode).
# local (default)
$ csnp push
# global (VSCode)
$ csnp push --global
code-snippets to .csnp
Sync all snippets from local or global(VSCode) and store in .csnp dir.
# local (default)
$ csnp pull
# global (VSCode)
$ csnp pull --global
Link
Using Snippet in Visual Studio Code.
License
MIT