{"id":14982769,"url":"https://github.com/jevonsflash/snippet-craft","last_synced_at":"2026-02-16T11:02:15.159Z","repository":{"id":254148074,"uuid":"834778028","full_name":"jevonsflash/snippet-craft","owner":"jevonsflash","description":"一个VS Code代码片段管理插件","archived":false,"fork":false,"pushed_at":"2024-08-22T15:59:57.000Z","size":1101,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T15:47:40.911Z","etag":null,"topics":["snippets","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=linxiao-matoapp.snippet-craft","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jevonsflash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-28T10:33:17.000Z","updated_at":"2024-08-24T06:25:55.000Z","dependencies_parsed_at":"2024-09-28T08:01:10.274Z","dependency_job_id":"04e34041-4404-43ae-8887-1ac43f34dec3","html_url":"https://github.com/jevonsflash/snippet-craft","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"15d2cd35dc672094a886d00144cf663e275bfb77"},"previous_names":["jevonsflash/snippet-craft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jevonsflash/snippet-craft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jevonsflash%2Fsnippet-craft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jevonsflash%2Fsnippet-craft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jevonsflash%2Fsnippet-craft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jevonsflash%2Fsnippet-craft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jevonsflash","download_url":"https://codeload.github.com/jevonsflash/snippet-craft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jevonsflash%2Fsnippet-craft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29506320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["snippets","vscode","vscode-extension"],"created_at":"2024-09-24T14:05:59.198Z","updated_at":"2026-02-16T11:02:15.143Z","avatar_url":"https://github.com/jevonsflash.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snippet Craft\n\n一个VS Code代码片段管理插件\n\n## 功能\n\n### 创建和插入代码片段\n\n\n在编辑器区域右键菜单中点击插入Snippet，或在代码片段视图中点击条目，则会将代码片段插入到当前激活文档的光标位置。\n\n![alt text](./Assets/1.gif)\n\n###  代码片段编辑\n\n代码片段在左侧栏中，根据创建时的文件内容类型，分组显示代码片段，可编辑已有的代码片段。\n\n![alt text](./Assets/2.gif)\n\n\n\n\n### 代码片段预览\n\n\n鼠标移动到代码片段条目上时，显示tooltip预览\n\n![alt text](./Assets/4.png)\n\n\n\n\n\n### 默认映射\n\n映射是插入代码片段时，自动替换的变量。\n\n代码片段中通过设置占位符`${VAR_NAME}`，在插入代码片段时，将自动替换为全局变量中的值。可用的映射如下表：\n\n|**类别**|**变量**|**描述**|\n|---|---|---|\n|**文件和编辑器相关**|TM\\_SELECTED\\_TEXT|当前选定的文本或空字符串|\n||TM\\_CURRENT\\_LINE|当前行的内容|\n||TM\\_CURRENT\\_WORD|光标下的单词或空字符串的内容|\n||TM\\_LINE\\_INDEX|基于零索引的行号|\n||TM\\_LINE\\_NUMBER|基于一个索引的行号|\n||TM\\_FILENAME|当前文档的文件名|\n||TM\\_FILENAME\\_BASE|当前文档的文件名（不含扩展名）|\n||TM\\_DIRECTORY|当前文档的目录|\n||TM\\_FILEPATH|当前文档的完整文件路径|\n||RELATIVE\\_FILEPATH|当前文档的相对文件路径（相对于打开的工作区或文件夹）|\n||CLIPBOARD|剪贴板的内容|\n||WORKSPACE\\_NAME|打开的工作区或文件夹的名称|\n||WORKSPACE\\_FOLDER|打开的工作区或文件夹的路径|\n||CURSOR\\_INDEX|基于零索引的游标编号|\n||CURSOR\\_NUMBER|基于单索引的游标编号|\n|**时间相关**|CURRENT\\_YEAR|本年度|\n||CURRENT\\_YEAR\\_SHORT|当年的最后两位数字|\n||CURRENT\\_MONTH|两位数字的月份（例如“02”）|\n||CURRENT\\_MONTH\\_NAME|月份的全名（例如“July”）|\n||CURRENT\\_MONTH\\_NAME\\_SHORT|月份的简短名称（例如“Jul”）|\n||CURRENT\\_DATE|以两位数字表示的月份中的某一天（例如“08”）|\n||CURRENT\\_DAY\\_NAME|日期的名称（例如“星期一”）|\n||CURRENT\\_DAY\\_NAME\\_SHORT|当天的简短名称（例如“Mon”）|\n||CURRENT\\_HOUR24|小时制格式的当前小时|\n||CURRENT\\_MINUTE|两位数的当前分钟数|\n||CURRENT\\_SECOND|当前秒数为两位数|\n||CURRENT\\_SECONDS\\_UNIX|自 Unix 纪元以来的秒数|\n||CURRENT\\_TIMEZONE\\_OFFSET|当前 UTC 时区偏移量为 +HH \u003cbr\u003e 或者 -HH \u003cbr\u003e (例如“-07:00”)|\n|**其他**|RANDOM6|6 个随机 Base-10 数字|\n||RANDOM\\_HEX6|6 个随机 Base-16 数字|\n||UUID|第四版UUID|\n\n\n注意：当自定义映射值未设置或者不可用时，将直接显示变量占位符\n\n\n### 自定义映射\n\n\n扩展初始化时，插入了三个常用的自定义映射，你可以自由更改或添加自定义映射。\n\n![alt text](Assets/5.png)\n\n\n\n示例：\n\n代码片段内容\n```\nvalue of 'AUTHOR' is: ${AUTHOR}\nvalue of 'COMPANY' is: ${COMPANY}\nvalue of 'MAIL' is: ${MAIL}\nvalue of 'FOOBAR' (non-exist) is: ${FOOBAR}\n```\n插入代码片段后，显示如下：\n```\nvalue of 'AUTHOR' is: 林晓lx\nvalue of 'COMPANY' is: my-company\nvalue of 'MAIL' is: jevonsflash@qq.com\nvalue of 'FOOBAR' (non-exist) is: ${FOOBAR}\n```\n\n\n与自定义映射一样，当默认映射值未设置或者不可用时，将直接显示变量占位符\n\n\n### 自动完成\n\n代码片段可在编辑器中显示自动提示和补全内容。\n\n![alt text](Assets/3.gif)\n\n## 快速开始\n\n通过点击上方横幅上的安装按钮安装 Snippet Craft，或在 VS Code 的扩展侧边栏中搜索 Snippet Craft 进行安装。\n\n## 更新内容\n\n|  Date  |  Version   | Content                                                                                         |\n| :----: | :--------: | :---------------------------------------------------------------------------------------------- |\n| V0.1.0 | 2024-8-22  | 初始版本                                                        \n\n## Todo\n\n* [ ] 支持更多语言\n* [ ] 使用monaco-editor\n* [ ] 导入导出功能\n\n## 作者信息\n\n作者：林小\n\n邮箱：jevonsflash@qq.com\n\n\n\n## License\n\nThe MIT License (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjevonsflash%2Fsnippet-craft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjevonsflash%2Fsnippet-craft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjevonsflash%2Fsnippet-craft/lists"}