高级查找放;更换/文本展开/宏 [英] Advanced Find & Replace / Text Expand / Macros
问题描述
希望一个很好的一个快的人.我正在做一个项目,需要在400个左右的位置写一个特定的链接.每个链接都一样,不同之处在于其中包含城镇名称,例如:
Hopefully a nice quick one for someone. I'm working on a project that requires a specific link being written around 400 or so locations. Each link is the same, except it has the town's name in it, such as:
<li><a href="/contact-details.html?location=Andover">Andover</a></li>
我目前正在使用Komodo Edit编写项目,并且已经安装了Zen Coding,并且对内置的Snippets功能有相当的了解.
I'm currently using Komodo Edit to write my projects, and I have Zen Coding installed and a decent knowledge of the built-in Snippets functionality.
我知道使用片段,可以通过键绑定从Andover单词创建以上链接,但据我一次只知道一行.
I know that using Snippets, I could create the link above from the word Andover in a key-binding, but as far as I know only one line at a time.
我也知道我可以使用Zen Coding进入以下阶段:
I also know that I could use Zen Coding to get to the stage of:
<li><a href="/contact-details.html?location=">Andover</a></li>
但在链接中没有位置名称,方法是使用带有缩写的换行和
but without the location name in the link by using wrap with abbreviation and
li*>a[href=/contact-details.html?location=]
显然这两个仍然留下了很多的工作要做,而且我敢肯定,这可能与科莫多宏,但我不知道有足够的了解他们这样做.
Obviously both of these still leave quite a lot of work to do, and I'm sure it's possible with a Komodo macro but I don't know enough about them to do that.
有人知道在Komodo中使用Zen Coding或使用任何网站或应用程序可以进行这种稍微高级的查找/替换/文本扩展的方法吗?我已经看到了你的查找和替换了几个应用程序,但它们都立足各地的多个文件,这是一个有点吃不消了我所需要的.
Does anyone know of a way in Komodo, or using Zen Coding, or any website or application, that can do this kind of slightly more advanced find/replace / text-expansion? I've seen a few applications that do find and replace but they all base themselves around multiple files and that's a bit much for what I need.
理想情况下,我可以这样写
Ideally, so I can write things like
<li><a href="/contact-details.html?location=[%contentOfCurrentLine]">[%contentOfCurrentLine]</a></li>
和复制它在所有400个地点一气呵成.
and replicate it over all 400 locations in one go.
推荐答案
您可以在 Komode 中进行操作.
You can do that in Komode.
- 转到"编辑"(在顶部菜单中),"查找".
- 将打开一个窗口,选中chackbox"替换"(或您需要的其他图标)
- 完成文本字段"查找内容"和"替换为",然后单击"全部替换"
- Go to "Edit" ( in top menu), "Find".
- Will open a window, check the chackbox "Replace" (or others that you need)
- Complete the text fields "find what" and "replace with", them click "Replace All"
就这样!
这篇关于高级查找放;更换/文本展开/宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!