vscode 当做记事本,用任务 tasks 自动提交git - ctrl shift B

发布时间 2023-04-21 10:56:30作者: 彭成刚

vscode 当做记事本,用任务 tasks 自动提交git - ctrl shift B

起因

  • 开始用的joplin 本地记事本挺好,唯一缺点不能同步。
  • 用了一下,发现markdown是两栏的,变成一栏就是html的。
  • 如果要是两栏,我能接受的话,那就直接vscode不就完了吗

代码

tasks.json

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  // Ctrl Shift B 运行
  "version": "2.0.0",
  "tasks": [
    {
      "label": "记事本自动提交", // 任务名称
      "command": "cmd.exe", // 使用 cmd.exe 执行
      "args": ["/c", "up.bat"], // bat 文件路径
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

up.bat

git add .
git commit -m 'up'
git push