1.4.1 • Published 11 months ago

csnp v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Install

pnpm i -g csnp # recommend

npm i -g csnp

yarn i -g csnp

bun i -g csnp

csnp

Using interactive prompts to generate .csnp files for managing vscode code snippets.

Rule csnp Path

The expected path for your snippets is:

.csnp/{SnippetType}/{SnippetName}.csnp

For example:

.csnp/js/log.csnp

SnippetType: js
SnippetName: log

Details

Open the file .csnp/js/log.csnp and edit the default code snippets as follows:

---
name: Log
prefix: '-log'
description: log something
---

code snippets
  • name: The name of the snippet.
  • prefix: The trigger text for the snippet in editor.
  • description: A brief description of what the snippet does.
  • code snippets: The actual code that will be inserted.

Just edit and replace the line code snippets of console.log.

---
name: Log
prefix: '-log'
description: log sth
---

console.log($1)

After editing, use the command:

csnp push

Then in editor you need to type the prefix -log and press Enter to generate the code.

Transforming Snippets

You can transform all .csnp files and store them locally or globally(in VSCode).

# local (default)
$ csnp push

# global (VSCode)
$ csnp push --global

Syncing Snippets

To sync all snippets from local or global(VSCode) and store them in .csnp directory.

# local (default)
$ csnp pull

# global (VSCode)
$ csnp pull --global

Usage Information

# csnp -h
csnp --help

Links

How to use Snippet in Visual Studio Code.

License

MIT @ Junxio.

1.4.1

11 months ago

1.4.0

12 months ago

1.3.9

12 months ago

1.3.8

12 months ago

1.2.8

12 months ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago