【问题标题】:In WebStorm, how to use live templates in .txt files?在 WebStorm 中,如何在 .txt 文件中使用实时模板?
【发布时间】:2023-03-19 09:34:01
【问题描述】:

我在所有 WebStorm 项目中都保留了一个“notes.txt”文件。

如何使用插入实时模板 (Ctrl + J)、实时模板环绕 (Ctrl + Alt + J)、环绕 (Ctrl + Alt + T) 在 .txt 文件中?

另外,如何为特定文件后缀创建实时模板上下文

例如,在我的 notes.txt 文件中,我想用

包围 The Selection
  • []
  • ()

【问题讨论】:

    标签: webstorm intellij-13


    【解决方案1】:

    如何在 .txt 文件中使用插入实时模板 (Ctrl + J)、环绕实时模板 (Ctrl + Alt + J)、环绕 (Ctrl + Alt + T)?

    使用Other 上下文


    另外,如何为特定文件后缀创建实时模板上下文?

    作为普通的 IDE 用户(通过一些 GUI)——不可能(没有这样的功能)。只能通过自定义插件。


    例如,在我的 notes.txt 文件中,我想用

    包围 The Selection
    • [] 和
    • ()

    您不需要实时模板。

    您只需要Settings/Preferences | Editor | General | Smart Keys --> Surround selection on typing quote or brace

    但是如果你坚持使用实时模板——使用Other上下文(见上面的截图——实时模板就是这样做的)

    【讨论】:

    • 谢谢,L.O.. 我真的很喜欢 Smart Keys 选项。效果很好。
    猜你喜欢
    • 1970-01-01
    • 2016-08-27
    • 1970-01-01
    • 2015-06-29
    • 2015-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-14
    相关资源
    最近更新 更多