Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>edit-articleNew to Visual Studio Code? Get it now.
edit-article

edit-article

wzyan

|
52 installs
| (0) | Free
自动编辑并格式化待发布的文章内容
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

面向的问题

微医前端发文存在自己的固定格式,主要包含

  • ([\u4e00-\u9fa5]+)([\da-zA-Z]+)替换为$1 $2:中文和英文要有一个空格
  • ([\da-zA-Z]+)([\u4e00-\u9fa5]+)替换为$1 $2:中文和英文要有一个空格
  • !\[.+\]替换为![]:处理图片描述 这些动作每次需要人为处理,费时费力且易出错,固化流程尝试改用vscode插件自动实现,遂有edit-article插件出现

使用执行

安装插件

在vscode侧边的扩展中搜索【edit-article】安装。

执行插件

插件只会在打开md格式文件时被激活,提供format-article命令,在命令面板执行此命令即可。唤起命令面板快捷键如下

  • mac:cmd + shift + p
  • win:ctrl + shift + p

使用效果

2022-05-08 23.28.59

未启动的命令

// { 插入log日志
        "command": "edit-article.insertLog",
        "title": "insertLog"
      //   "command": "edit-article.helloWorld",
      //   "title": "Hello edit-article"
      // },
      // { 选中的字符反转
      //   "command": "edit-article.reserve",
      //   "title": "Hello reserve"
      // },
      // { 选中的代码块上下插入console.time
      //   "command": "edit-article.insertTime",
      //   "title": "insertTime"
      // },
      // { 删除当前文档中所有的log
      //   "command": "edit-article.delLog",
      //   "title": "delLog"
      // },

注释的快捷键

{
        "key": "ctrl+h",
        "command": "edit-article.helloWorld"
      },
      {
        "key": "ctrl+shift+r",
        "command": "edit-article.reserve"
      },
      {
        "key": "ctrl+shift+t",
        "command": "edit-article.insertTime"
      }
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft