Komodo 编辑:如何进行一些基本的宏和代码片段操作?

发布于 2024-07-11 06:14:37 字数 755 浏览 4 评论 0原文

我想知道如何执行这些基本操作(或在哪里可以找到文档) Komodo Edit 中的宏和片段操作。

  • 1) FILE/IO:从 komodo javascript 宏中将字符串写入临时文件

  • 2) FILE/IO:将文本文件的内容读入 komodo javascript 宏中的字符串

  • 3) 包括:在宏中交叉引用本地 javascript“包含”库, 或相当于 #script src="~/mylocal_javascript_addons.js" 的内容,这样我就可以合并宏代码。

  • 4) SNIPPET_OUTPUT:创建一个片段插值占位符,返回 用户定义的 JavaScript 函数或宏。

    例如:

    [[%(myscript:SayHelloWorld())]]

    [[%(foomacro-MyAgeInMilliseconds)]]

  • 5) MACRO_OUTPUT:宏当前缓冲区中的多行选择并传递 将其保存到本地脚本或批处理文件,然后用输出替换选择 结果。 (需要一种方法在 MSFT Windows 中执行此操作,而不仅仅是 Linux)。

如果您可以使用 Python 而不是 Javascript 回答其中的一个或多个问题,那就太好了,但请包含示例代码或指向它的链接,因为 Python 文档似乎非常 TODO。

I am wondering how to do (or where to find documentation) on these basic
macro and snippet operations in Komodo Edit.

  • 1) FILE/IO: write a string to a temporary file from within a komodo javascript macro

  • 2) FILE/IO: read the content of a text file into a string within a komodo javascript macro

  • 3) INCLUDES: cross-reference local javascript "include" libraries within a macro,
    or something equivalent to #script src="~/mylocal_javascript_addons.js" So I can consolidate macro code.

  • 4) SNIPPET_OUTPUT: create a snippet interpolation placeholder that returns the output of a
    user-defined javascript function or macro.

    For example:

    [[%(myscript:SayHelloWorld())]]

    [[%(foomacro-MyAgeInMilliseconds)]]

  • 5) MACRO_OUTPUT: macro that takes a multiple-line selection in the current buffer and passes
    it to a local script or batch file, and then replaces the selection with the output
    result. (Need a way to do this in MSFT Windows, not just linux).

If you can answer one or more of these using Python instead of Javascript, that's great, but please include sample code or a link to it, because the Python documentation seems to be extremely TODO.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

音盲 2024-07-18 06:14:37

没有答案,但您可能会更幸运在这里提问:

http://community。 activestate.com/forums/komodo-extensions

Don't have your answers, but you might have more luck asking here:

http://community.activestate.com/forums/komodo-extensions

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文