如何使用命令全选后删除

我的日记模板有2个,主要区别是当天的模板内含有天气插件的触发词用来记录当前天气,其他应该也有一些细节不同。
新建笔记只能默认一个模板,我目前比较多操作,现在想合并为一个命令一键执行:

  1. 切换为源码模式
  2. 全选
  3. 删除全部
  4. 插入新模板
  5. 切换为实时编辑

现在 2全选 不知道咋变成命令,QuickAdd的剪切倒是可以替代 3删除

用 templater 可以将新模板直接覆盖旧笔记,就行

直接覆盖是新增内容 :pensive:

新增还是覆盖自己写代码判定嘛,很好解决的,主要还是看个人需求

类似我目前使用的这样,路由不同的模板就行

<%*
// 路由配置区(用户只需维护用户选项与模块模板路径)
const userOptions = ["代码块","行代码", "TODO", "外链", "callout","简易时间戳","MD状态变更","PARA领域变更","项目初始化"];
const modulePaths = [
  "[[module_getCodeBlock]]",
  "[[module_getInlineCode]]",
  "[[module_getTODO]]",
  "[[module_getOutLink]]",
  "[[module_getCallout]]",
  "[[module_getDateStr]]",
  "[[module_updateMD]]",
  "[[module_updatePARA]]",
  "[[module_projectStart]]"
];

// 执行区
const choice = await tp.system.suggester(userOptions, userOptions);
if (!choice) {
  new Notice("操作已取消");
  return;
}

const index = userOptions.indexOf(choice);
const output = await tp.file.include(`${modulePaths[index]}`);

if (output) {
  tR += output;
}
%>