Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>KakashiNew to Visual Studio Code? Get it now.
Kakashi

Kakashi

sosososolong

|
30 installs
| (0) | Free
Insert snippets in multi files by custom settings in operation.json5
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Kakashi

介绍

不同的项目自定义一些快速定位, 快速插入代码片段的快捷操作

软件架构

软件架构说明

安装教程

  1. xxxx
  2. xxxx
  3. xxxx

使用说明

  1. 安装插件后, 项目根目录创建operation.json5文件
  2. 配置格式如下
    [
      // 插入代码
      {
        // 文当前的操作添加标题, 会出现在下拉选择框中
        "key": "log",
        // 要入代码的目标文件部分路径, 如果为空, 则默认选择当前打开的文件
        "path": "src/api/records.js",
        // 一个文件中的所有子操作
        "operations": [
          // 有时候一个操作在一个文件中, 可能包含多个子操作, 每个子操作进行一次定位和插入代码片段动作
          {
            // 正则数组, 匹配任意一个, 则取消当前子操作, 正则为正则的字符串格式, 如'/<el-table-column type="selection" align="center"\\s*\\/>/g'
            "cancelMatches": [],
            // 格式同上, 如果有多个, 则一个一个进行尝试匹配
            "matches": [],
            // 如果有多个snippet, 那么插件会让程序员选择
            "snippets": [
              "console.log('hello world')"
            ],
            // 0表示在matches中正则匹配的位置后面插入snippet; 1表示在匹配位置的下一行插入snippet
            "insertType": 1
          }
        ],
        // operations的操作位置就是path指定的文件, 没有指定path的话就是当前文件
        // 如果同时还需要操作其他文件, 那么需要指定nextAction字段, 结构同上
        "nextAction": {
          "path": "xxx",
          "operations": [
            {
              "cancelMatches": [],
              "matches": [],
              "snippets": [],
              "insertType": 1
            }
          ]
        }
      },
    
      // 快速定位
      {
        "key": "go to: api file",
        "path": "src/api/records.js",
        "operations": [
          {
            "matches": []
          }
        ]
      },
      // 清除配置缓存, 重新读取配置文件(修改配置文件后, 如添加新的操作后, 需要重新读取配置文件)
      {
        "key": "clear cache"
      }
    ]
    

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft