TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: I wrote a tool that generate VS Code code snippets

1 点作者 djyde超过 4 年前

1 comment

djyde超过 4 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;djyde&#x2F;snp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;djyde&#x2F;snp</a><p>When I found myself repeat typing some codes over and over again, I started to use code snippet help me generate these codes. It saved me so much time.<p>But VS Code snippet syntax [1] is hard to write and maintain. So I find some code snippet manager applications, but they are all just help me copy and paste. However, the IDE native code snippet can do a lot more than just generate codes.<p>So I wrote a command line tool that generates the VS Code snippet file. It looks up all the `.snp` files (which is a file contains the snippet code) in current working directory and generate the code-snippets file to VS Code snippets folder. You don&#x27;t have to do anything in VS Code and it just work.<p>You could see how do I use this tool to manage my snippets: <a href="https:&#x2F;&#x2F;github.com&#x2F;djyde&#x2F;snippets" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;djyde&#x2F;snippets</a><p>(P.S. This is my first time writing Go code. I first write this tool in Node.js in 30 mins. Then I want to make it a single executable file. So I rewrite it in Go. It cost me 2 hours :P)<p>- [1] <a href="https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;editor&#x2F;userdefinedsnippets" rel="nofollow">https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;editor&#x2F;userdefinedsnippet...</a>