DEV Community

Cover image for A awesome cli-tool for cooking VSCode snippets.
RssXio
RssXio

Posted on • Edited on

2

A awesome cli-tool for cooking VSCode snippets.

csnp now is release 1.4.0!

Introduction

csnp is a node script written by typescript

Based on VS Code built-in customizable code snippets(official documentation introduction)

Give developers the ability to create VS Code snippets quickly and easily

Usage Scene

In your code file, use the command -log and press enter to generate the code console.log('-> log', _)_ is the position of the cursor

In the .code-snippet file of VS Code

  • command -log represents a prefix

  • codes console.log('-> log', _) represents a body

The csnp command can generate the log.csnp file quickly, which can be managed by markdown friendly syntax and generated under the root path of the project

exp: .vscode/.csnp/js/log.csnp

The js of the path in csnp is stand for csnp type

Easy Start

# 1. install global
$ npm i -g csnp

# 2. init csnp file
$ csnp

# 3. open csnp file,edit your own code snippets

# 4. generate code snipepts
$ csnp push
Enter fullscreen mode Exit fullscreen mode

.csnp File

---
name: Log
prefix: '-log'
description: "log sth"
---
console.log('-> log', $1)
Enter fullscreen mode Exit fullscreen mode

The log.csnp will converts the js.code-snippets file by executing the 'csnp push' command, then you can use the '-log' command.

.code-snippets File

The js.code-snippets file is a piece of json, and VS Code will automatically parses the file with this suffix file.

{
  "Log": {
    "prefix": "-log",
    "body": [
      "console.log($1)"
    ],
    "description": "log sth"
  }
}
Enter fullscreen mode Exit fullscreen mode

End

If you think csnp helpful, thanks for your star ⭐️ ~

Github Link

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay