Advanced Find & Replace / Text Expand / Macros

↘锁芯ラ 提交于 2019-12-02 06:53:25

Use a snippet like this named 'ListLink':

<li><a href="/contact-details.html?location=[[%W]]">[[%W]]</a></li>

And create a macro using the scimoz and projects APIs to move the cursor and call the snippet in a loop:

komodo.assertMacroVersion(2);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }

var i = 1;
var len = ko.views.manager.currentView.scimoz.lineCount; /* Count lines */
_part = ko.projects.findPart('snippet', 'ListLink', '*'); /* Find Snippet*/
ko.views.manager.currentView.scimoz.documentStart(); /* goto first line */

while (i <= len)
  {
  if (!_part) {alert("Couldn't find a snippet called 'ListLink' when executing macro."); return;}
  ko.projects.invokePart(_part); /* invoke Snippet */
  ko.views.manager.currentView.scimoz.lineDown(); /* goto next line */
  i++;
  }
André Araujo Rosa

You can do that in Komode.

  1. Go to "Edit" ( in top menu), "Find".
  2. Will open a window, check the chackbox "Replace" (or others that you need)
  3. Complete the text fields "find what" and "replace with", them click "Replace All"

Just it!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!